Skip to content

Commit c0c9e96

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm, compiler] Don't try to compile implicit closure functions for abstract entry points.
TEST=ci Bug: #53653 Change-Id: I5185174ac1f2abddb3b0eeb1fbeb7f4484a328c8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329500 Reviewed-by: Alexander Markov <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 5f2610d commit c0c9e96

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) 2023, 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+
// The Dart Project Fuzz Tester (1.101).
6+
// Program generated as:
7+
// dart dartfuzz.dart --seed 3834582911 --no-fp --no-ffi --flat
8+
// @dart=2.14
9+
10+
class X0 {
11+
@pragma("vm:entry-point")
12+
@pragma("vm:never-inline")
13+
call() {}
14+
}
15+
16+
class X2 with X0 {
17+
call() {
18+
throw "null";
19+
}
20+
}
21+
22+
main() {
23+
try {
24+
X2()();
25+
} catch (e, st) {
26+
print('X2() throws');
27+
}
28+
}

runtime/vm/compiler/aot/precompiler.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,9 @@ void Precompiler::AddAnnotatedRoots() {
16001600
!function.IsSetterFunction()) {
16011601
function2 = function.ImplicitClosureFunction();
16021602
functions_with_entry_point_pragmas_.Insert(function2);
1603-
AddFunction(function2, RetainReasons::kEntryPointPragma);
1603+
if (!function.is_abstract()) {
1604+
AddFunction(function2, RetainReasons::kEntryPointPragma);
1605+
}
16041606

16051607
// Not `function2`: Dart_GetField will lookup the regular function
16061608
// and get the implicit closure function from that.

0 commit comments

Comments
 (0)