Skip to content

Commit 0180af2

Browse files
committed
Version 2.16.1
* Cherry-pick e4942db to stable * Cherry-pick b285d21 to stable
2 parents 547d54e + 396a171 commit 0180af2

File tree

5 files changed

+55
-3
lines changed

5 files changed

+55
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## 2.16.0
1+
## 2.16.1 - 2022-02-09
2+
3+
This is a patch release that fixes an AOT precompiler crash when building some
4+
Flutter apps (issue [flutter/flutter#97301][]).
5+
6+
[flutter/flutter#97301]: https://github.com/flutter/flutter/issues/97301
7+
8+
## 2.16.0 - 2022-02-03
29

310
### Core libraries
411

runtime/vm/compiler/frontend/kernel_to_il.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfRecognizedMethod(
15851585
// Initialize the result's data pointer field.
15861586
body += LoadLocal(typed_data_object);
15871587
body += LoadLocal(arg_pointer);
1588-
body += LoadNativeField(Slot::Pointer_data_field());
1588+
body += LoadUntagged(compiler::target::Pointer::data_field_offset());
1589+
body += ConvertUntaggedToUnboxed(kUnboxedIntPtr);
15891590
body += StoreNativeField(Slot::TypedDataBase_data_field(),
15901591
StoreInstanceFieldInstr::Kind::kInitializing,
15911592
kNoStoreBarrier);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
//
5+
// Verifies that there are no deoptimizing IntConverter instructions
6+
// used when converting Pointer to TypedData.
7+
// Regression test for https://github.com/flutter/flutter/issues/97301.
8+
9+
import "dart:ffi";
10+
import "package:ffi/ffi.dart";
11+
12+
@pragma("vm:never-inline")
13+
Pointer<Uint32> foo() => calloc(4);
14+
15+
main() {
16+
final Pointer<Uint32> offsetsPtr = foo();
17+
18+
for (var i = 0; i < 2; i++) {
19+
print(offsetsPtr.asTypedList(1));
20+
}
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
//
5+
// Verifies that there are no deoptimizing IntConverter instructions
6+
// used when converting Pointer to TypedData.
7+
// Regression test for https://github.com/flutter/flutter/issues/97301.
8+
9+
// @dart = 2.9
10+
11+
import "dart:ffi";
12+
import "package:ffi/ffi.dart";
13+
14+
@pragma("vm:never-inline")
15+
Pointer<Uint32> foo() => calloc(4);
16+
17+
main() {
18+
final Pointer<Uint32> offsetsPtr = foo();
19+
20+
for (var i = 0; i < 2; i++) {
21+
print(offsetsPtr.asTypedList(1));
22+
}
23+
}

tools/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
CHANNEL stable
2727
MAJOR 2
2828
MINOR 16
29-
PATCH 0
29+
PATCH 1
3030
PRERELEASE 0
3131
PRERELEASE_PATCH 0

0 commit comments

Comments
 (0)