Skip to content

Commit 73dd5f7

Browse files
alexmarkovcommit-bot@chromium.org
authored andcommitted
[vm,aot,bytecode] Do not depend on presence of _AsyncAwaitCompleter
In AOT mode tree shaker can remove _AsyncAwaitCompleter class, so bytecode generator should not crash if it can't find this class in the core library. The only use of _AsyncAwaitCompleter in bytecode generator is to mark _AsyncAwaitCompleter.get:future as non-debuggable. This change fixes crash when building Flutter engine in host/release configuration with unreachable code elimination (https://dart-review.googlesource.com/c/sdk/+/121901). Change-Id: I7724ef6ae51b2b2039bb113c5c7328956bf6e99d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122167 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
1 parent 7b39f43 commit 73dd5f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/vm/lib/bytecode/gen_bytecode.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
10711071

10721072
Procedure _asyncAwaitCompleterGetFuture;
10731073
Procedure get asyncAwaitCompleterGetFuture =>
1074-
_asyncAwaitCompleterGetFuture ??= libraryIndex.getMember(
1074+
_asyncAwaitCompleterGetFuture ??= libraryIndex.tryGetMember(
10751075
'dart:async', '_AsyncAwaitCompleter', 'get:future');
10761076

10771077
Procedure _setAsyncThreadStackTrace;

0 commit comments

Comments
 (0)