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

Side by Side Diff: tests/language/issue9939_test.dart

Issue 13912013: Fix issue 9939 by making the body of a try block have two successors: the join block after the try/… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // dart2js was generating incorrect code for the [A] constructor, by
6 // using a temporary variable for two instructions, even though they
7 // are both live at the same time.
8
9 import "package:expect/expect.dart";
10
11 var globalVar = [1, 2];
12
13 class A {
14 final field1;
15 final field2;
16 var field3;
17
18 A(this.field1, this.field2) {
19 bool entered = false;
20 // We use [field1] twice to ensure it will have a temporary.
21 for (var a in field1) {
22 try {
23 entered = true;
24 // We use [field2] twice to ensure it will have a temporary.
25 print(field2);
26 print(field2);
27 } catch (e) {
28 // Because the catch is aborting, the SSA graph we used to
29 // generate thought that the whole try/catch was aborting, and
30 // therefore it could not reach the code after the loop.
31 throw e;
32 }
33 }
34 Expect.isTrue(entered);
35 // dart2js used to overwrite the temporary for [field1] with
36 // [field2].
37 Expect.equals(globalVar, field1);
38 }
39 }
40
41 main() {
42 new A(globalVar, null);
43 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698