Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(967)

Unified Diff: tests/language/vm/unregistered_closure_in_finally_test.dart

Issue 3003253002: [vm, aot] Ensure fixups applied after the world has been compiled are applied to closures in finall… (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/precompiler.cc ('K') | « runtime/vm/runtime_entry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/unregistered_closure_in_finally_test.dart
diff --git a/tests/language/vm/unregistered_closure_in_finally_test.dart b/tests/language/vm/unregistered_closure_in_finally_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..135be5d0540db5ab30b8179aefc2e3c9d3e815ed
--- /dev/null
+++ b/tests/language/vm/unregistered_closure_in_finally_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2017, 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=--no-background-compilation --enable-inlining-annotations
+
+const NeverInline = 'NeverInline';
+
+@NeverInline
+doSomething() {
+ print("Hello!");
+}
+
+@NeverInline
+maybeThrow(bool doThrow) {
+ if (doThrow) {
+ throw new Exception();
+ }
+}
+
+@NeverInline
+run(action) {
+ try { action(); } catch(e) {}
+}
+
+test(bool doThrow) {
+ try {
+ maybeThrow(doThrow);
+ } finally {
+ run(() {
+ doSomething(); // Should not crash here.
+ });
+ }
+}
+
+main() {
+ try { test(true); } catch(e) {}
+ try { test(false); } catch(e) {}
+}
« runtime/vm/precompiler.cc ('K') | « runtime/vm/runtime_entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698