Skip to content

Commit

Permalink
Version 2.16.1
Browse files Browse the repository at this point in the history
* Cherry-pick e4942db to stable
* Cherry-pick b285d21 to stable
  • Loading branch information
sortie committed Feb 8, 2022
2 parents 547d54e + 396a171 commit 0180af2
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
## 2.16.0
## 2.16.1 - 2022-02-09

This is a patch release that fixes an AOT precompiler crash when building some
Flutter apps (issue [flutter/flutter#97301][]).

[flutter/flutter#97301]: https://github.com/flutter/flutter/issues/97301

## 2.16.0 - 2022-02-03

### Core libraries

Expand Down
3 changes: 2 additions & 1 deletion runtime/vm/compiler/frontend/kernel_to_il.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfRecognizedMethod(
// Initialize the result's data pointer field.
body += LoadLocal(typed_data_object);
body += LoadLocal(arg_pointer);
body += LoadNativeField(Slot::Pointer_data_field());
body += LoadUntagged(compiler::target::Pointer::data_field_offset());
body += ConvertUntaggedToUnboxed(kUnboxedIntPtr);
body += StoreNativeField(Slot::TypedDataBase_data_field(),
StoreInstanceFieldInstr::Kind::kInitializing,
kNoStoreBarrier);
Expand Down
21 changes: 21 additions & 0 deletions tests/ffi/regress_flutter97301_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Verifies that there are no deoptimizing IntConverter instructions
// used when converting Pointer to TypedData.
// Regression test for https://github.com/flutter/flutter/issues/97301.

import "dart:ffi";
import "package:ffi/ffi.dart";

@pragma("vm:never-inline")
Pointer<Uint32> foo() => calloc(4);

main() {
final Pointer<Uint32> offsetsPtr = foo();

for (var i = 0; i < 2; i++) {
print(offsetsPtr.asTypedList(1));
}
}
23 changes: 23 additions & 0 deletions tests/ffi_2/regress_flutter97301_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
// Verifies that there are no deoptimizing IntConverter instructions
// used when converting Pointer to TypedData.
// Regression test for https://github.com/flutter/flutter/issues/97301.

// @dart = 2.9

import "dart:ffi";
import "package:ffi/ffi.dart";

@pragma("vm:never-inline")
Pointer<Uint32> foo() => calloc(4);

main() {
final Pointer<Uint32> offsetsPtr = foo();

for (var i = 0; i < 2; i++) {
print(offsetsPtr.asTypedList(1));
}
}
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
CHANNEL stable
MAJOR 2
MINOR 16
PATCH 0
PATCH 1
PRERELEASE 0
PRERELEASE_PATCH 0

0 comments on commit 0180af2

Please sign in to comment.