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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/issue9939_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 21614)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -4617,7 +4617,10 @@
startTryBlock = graph.addNewBlock();
open(startTryBlock);
visit(node.tryBlock);
- if (!isAborted()) endTryBlock = close(new HGoto());
+ // We use a [HExitTry] instead of a [HGoto] for the try block
+ // because it will have multiple successors: the join block, and
+ // the catch or finally block.
+ if (!isAborted()) endTryBlock = close(new HExitTry());
SubGraph bodyGraph = new SubGraph(startTryBlock, lastOpenedBlock);
SubGraph catchGraph = null;
HLocalValue exception = null;
@@ -4776,6 +4779,7 @@
assert(startCatchBlock != null || startFinallyBlock != null);
endTryBlock.addSuccessor(
startCatchBlock != null ? startCatchBlock : startFinallyBlock);
+ endTryBlock.addSuccessor(exitBlock);
}
// The catch block has either the finally or the exit block as
« no previous file with comments | « no previous file | tests/language/issue9939_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698