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

Unified Diff: tests/language/regress_26453_test.dart

Issue 2004373004: Revert "Fix capturing variables in optimized compilations" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/regress_26453_test.dart
diff --git a/tests/language/regress_26453_test.dart b/tests/language/regress_26453_test.dart
deleted file mode 100644
index 32d6f59923416837b692342e8af949b4d74a8253..0000000000000000000000000000000000000000
--- a/tests/language/regress_26453_test.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2016, 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.
-
-// The program crashed with segfault because we when we first compile foo
-// and bar we allocate all four variables (a, b, c and d) to the context.
-// When we compile foo the second time (with optimizations) we allocate
-// only c and d to the context. This happened because parser folds away
-// "${a}" and "${b}" as constant expressions when parsing bar on its own,
-// i.e. the expressions were not parsed again and thus a and b were not
-// marked as captured.
-// This caused a mismatch between a context that bar expects and that
-// the optimized version of foo produces.
-
-foo() {
- const a = 1;
- const b = 2;
- var c = 3;
- var d = 4;
-
- bar() {
- if ("${a}" != "1") throw "failed";
- if ("${b}" != "2") throw "failed";
- if ("${c}" != "3") throw "failed";
- if ("${d}" != "4") throw "failed";
- }
-
- bar();
-}
-
-main() {
- for (var i = 0; i < 50000; i++) foo();
-}
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698