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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10032009: Fix a crash in graoh builder where a throw node is added in an expression tree by the parser: allow… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 6338)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1843,7 +1843,7 @@
}
-void EffectGraphVisitor::VisitThrowNode(ThrowNode* node) {
+void EffectGraphVisitor::BuildThrowNode(ThrowNode* node) {
ValueGraphVisitor for_exception(owner(), temp_index());
node->exception()->Visit(&for_exception);
Append(for_exception);
@@ -1861,10 +1861,24 @@
for_stack_trace.value());
}
AddInstruction(instr);
+}
+
+
+void EffectGraphVisitor::VisitThrowNode(ThrowNode* node) {
+ BuildThrowNode(node);
CloseFragment();
}
+// A throw cannot be part of an expression, however, the parser may replace
+// certain expression nodes with a throw. In that case generate a literal null
+// so that the fragment is not closed in the middle of an expression.
+void ValueGraphVisitor::VisitThrowNode(ThrowNode* node) {
+ BuildThrowNode(node);
+ ReturnValue(new ConstantVal(Instance::ZoneHandle()));
+}
+
+
void EffectGraphVisitor::VisitInlinedFinallyNode(InlinedFinallyNode* node) {
Bailout("EffectGraphVisitor::VisitInlinedFinallyNode");
}
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698