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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1569523002: Fix VM bug with try-catch inside of try-finally. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: added comment Created 4 years, 11 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/code_descriptors.h ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index fc3264f73803f73b2f0b5c582994155a13294668..ffeca95c562df5e84563d70bde50f36abb387958 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -4219,7 +4219,7 @@ void EffectGraphVisitor::VisitCatchClauseNode(CatchClauseNode* node) {
void EffectGraphVisitor::VisitTryCatchNode(TryCatchNode* node) {
InlineBailout("EffectGraphVisitor::VisitTryCatchNode (exception)");
- intptr_t original_handler_index = owner()->try_index();
+ const intptr_t original_handler_index = owner()->try_index();
const intptr_t try_handler_index = node->try_index();
ASSERT(try_handler_index != original_handler_index);
owner()->set_try_index(try_handler_index);
@@ -4291,13 +4291,14 @@ void EffectGraphVisitor::VisitTryCatchNode(TryCatchNode* node) {
}
if (finally_block != NULL) {
+ ASSERT(node->rethrow_clause() != NULL);
// Create a handler for the code in the catch block, containing the
// code in the finally block.
owner()->set_try_index(original_handler_index);
EffectGraphVisitor for_finally(owner());
for_finally.BuildRestoreContext(catch_block->context_var());
- finally_block->Visit(&for_finally);
+ node->rethrow_clause()->Visit(&for_finally);
if (for_finally.is_open()) {
// Rethrow the exception. Manually build the graph for rethrow.
Value* exception = for_finally.Bind(
« no previous file with comments | « runtime/vm/code_descriptors.h ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698