forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ VM ] Ignore contexts which have been optimized out during stack ove…
…rflow checks Fixes dart-lang/sdk#38182 Change-Id: I2b042b9a320e16fc88bee6ea2c0c93598e574c00 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115880 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Aart Bik <ajcbik@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
- Loading branch information
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2019, 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. | ||
|
||
// VMOptions=--stacktrace_every=1 --deterministic | ||
|
||
void foo1(par) { | ||
try { | ||
() { | ||
// The parameter `par` has to be captured within a closure, but it doesn't | ||
// matter whether or not it's actually used. | ||
print(par.runtimeType); | ||
}; | ||
// We need to throw, otherwise the crash doesn't happen. We don't need to | ||
// catch it explicitly, however. | ||
throw ''; | ||
} finally { | ||
// We need to trigger a lot of stack overflow checks. Somewhere around | ||
// 20000 seems to work. | ||
int x = 0; | ||
for (int loc1 = 0; loc1 < 20000; loc1++) { | ||
x += loc1; | ||
} | ||
print(x); | ||
} | ||
} | ||
|
||
main() { | ||
try { | ||
// Parameter isn't important. | ||
foo1(null); | ||
} catch (e) { | ||
print('foo1 threw'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters