File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025, 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+ // Environment=ASAN_OPTIONS=detect_stack_use_after_return=0
6+
7+ // ASAN's detect_stack_use_after_return (default on) has cost O(stack size) per
8+ // longjmp/noreturn function.
9+
10+ @pragma ("vm:never-inline" )
11+ foo (n) {
12+ try {
13+ throw 'a' ;
14+ } catch (e) {}
15+ if (n > 0 ) {
16+ // Function.apply is implemented as a native, so this introduces new entry
17+ // frames, checking that DartEntryScope saves things as needed.
18+ Function .apply (() => foo (n - 1 ), []);
19+ Function .apply (() => bar (n - 1 ), []);
20+ }
21+ try {
22+ throw 'a' ;
23+ } catch (e) {}
24+ }
25+
26+ // Stagger stack depth.
27+ @pragma ("vm:never-inline" )
28+ bar (n) {
29+ foo (0 );
30+ foo (n);
31+ foo (0 );
32+ }
33+
34+ main () {
35+ foo (10 );
36+ }
Original file line number Diff line number Diff line change 22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5+ // Environment=ASAN_OPTIONS=detect_stack_use_after_return=0
6+
7+ // ASAN's detect_stack_use_after_return (default on) has cost O(stack size) per
8+ // longjmp/noreturn function.
9+
510main () {
611 for (int i = 0 ; i < 1000000 ; ++ i) {
712 try {
You can’t perform that action at this time.
0 commit comments