Index: pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart |
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart |
index 79f018ba204d3015e358cc52f1275fe3e8c07523..91a5aac7d4c6367ae7fa746122cf67d44940a986 100644 |
--- a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart |
+++ b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart |
@@ -208,10 +208,11 @@ class BlockGraphBuilder extends RecursiveVisitor { |
visitStatement(node.body); // visitContinue will add predecessors to join. |
} |
- visitWhileCondition(WhileCondition node) { |
- Block join = _jumpTarget[node.label] = newBlock(); |
- join.predecessors.add(_currentBlock); |
- _currentBlock = join; |
+ visitFor(For node) { |
+ Block entry = _currentBlock; |
+ _currentBlock = _jumpTarget[node.label] = newBlock(); |
+ node.updates.forEach(visitExpression); |
+ joinFrom(entry, _currentBlock); |
visitExpression(node.condition); |
Block afterCondition = _currentBlock; |
branchFrom(afterCondition); |