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

Side by Side Diff: lib/compiler/implementation/ssa/validate.dart

Issue 10987073: Fix issue 5517 by setting the successors the right way in a try/catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class HValidator extends HInstructionVisitor { 5 class HValidator extends HInstructionVisitor {
6 bool isValid = true; 6 bool isValid = true;
7 HGraph graph; 7 HGraph graph;
8 8
9 void visitGraph(HGraph visitee) { 9 void visitGraph(HGraph visitee) {
10 graph = visitee; 10 graph = visitee;
(...skipping 19 matching lines...) Expand all
30 if (block.last is !HControlFlow) { 30 if (block.last is !HControlFlow) {
31 markInvalid("block ends with non-tail node."); 31 markInvalid("block ends with non-tail node.");
32 } 32 }
33 if (block.last is HIf && block.successors.length != 2) { 33 if (block.last is HIf && block.successors.length != 2) {
34 markInvalid("If node without two successors"); 34 markInvalid("If node without two successors");
35 } 35 }
36 if (block.last is HConditionalBranch && block.successors.length != 2) { 36 if (block.last is HConditionalBranch && block.successors.length != 2) {
37 markInvalid("Conditional node without two successors"); 37 markInvalid("Conditional node without two successors");
38 } 38 }
39 if (block.last is HGoto && block.successors.length != 1) { 39 if (block.last is HGoto && block.successors.length != 1) {
40 markInvalid("Goto node without one successor"); 40 markInvalid("Goto node with not exactly one successor");
41 } 41 }
42 if (block.last is HJump && block.successors.length != 1) { 42 if (block.last is HJump && block.successors.length != 1) {
43 markInvalid("Break or continue node without one successor"); 43 markInvalid("Break or continue node without one successor");
44 } 44 }
45 if (block.last is HReturn && 45 if (block.last is HReturn &&
46 (block.successors.length != 1 || !block.successors[0].isExitBlock())) { 46 (block.successors.length != 1 || !block.successors[0].isExitBlock())) {
47 markInvalid("Return node with > 1 succesor or not going to exit-block"); 47 markInvalid("Return node with > 1 succesor or not going to exit-block");
48 } 48 }
49 if (block.last is HExit && !block.successors.isEmpty()) { 49 if (block.last is HExit && !block.successors.isEmpty()) {
50 markInvalid("Exit block with successor"); 50 markInvalid("Exit block with successor");
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 markInvalid("Instruction in wrong block"); 170 markInvalid("Instruction in wrong block");
171 } 171 }
172 if (!hasCorrectInputs()) { 172 if (!hasCorrectInputs()) {
173 markInvalid("Incorrect inputs"); 173 markInvalid("Incorrect inputs");
174 } 174 }
175 if (!hasCorrectUses()) { 175 if (!hasCorrectUses()) {
176 markInvalid("Incorrect uses"); 176 markInvalid("Incorrect uses");
177 } 177 }
178 } 178 }
179 } 179 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698