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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 308053012: Fix try-catch and continue in switch statements. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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/switch_try_catch_test.dart » ('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 36866)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -89,11 +89,14 @@
: owner_(owner),
label_(label),
outer_(owner->nesting_stack_),
- break_target_(NULL) {
+ break_target_(NULL),
+ try_index_(owner->try_index()) {
// Push on the owner's nesting stack.
owner->nesting_stack_ = this;
}
+ intptr_t try_index() const { return try_index_; }
+
virtual ~NestedStatement() {
// Pop from the owner's nesting stack.
ASSERT(owner_->nesting_stack_ == this);
@@ -106,6 +109,7 @@
NestedStatement* outer_;
JoinEntryInstr* break_target_;
+ intptr_t try_index_;
srdjan 2014/06/02 18:29:31 const?
Florian Schneider 2014/06/03 10:50:18 Yes, I will add it in my next cl.
};
@@ -181,7 +185,7 @@
if (label != this->label()) return NULL;
if (continue_target_ == NULL) {
continue_target_ =
- new JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+ new JoinEntryInstr(owner()->AllocateBlockId(), try_index());
}
return continue_target_;
}
@@ -224,7 +228,7 @@
if (label != case_labels_[i]) continue;
if (case_targets_[i] == NULL) {
case_targets_[i] =
- new JoinEntryInstr(owner()->AllocateBlockId(), owner()->try_index());
+ new JoinEntryInstr(owner()->AllocateBlockId(), try_index());
}
return case_targets_[i];
}
« no previous file with comments | « no previous file | tests/language/switch_try_catch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698