Index: runtime/vm/scopes.cc |
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc |
index 6060e7a075a2df3d5fd149fb97980839685fb1d3..be2cdda24e44df3e4f8ead4de381fc92dfc5df4d 100644 |
--- a/runtime/vm/scopes.cc |
+++ b/runtime/vm/scopes.cc |
@@ -98,6 +98,14 @@ bool LocalScope::AddLabel(SourceLabel* label) { |
} |
+void LocalScope::MoveLabel(SourceLabel* label) { |
+ ASSERT(LocalLookupLabel(label->name()) == NULL); |
+ ASSERT(label->kind() == SourceLabel::kForward); |
+ labels_.Add(label); |
+ label->set_owner(this); |
+} |
+ |
+ |
NameReference* LocalScope::FindReference(const String& name) const { |
ASSERT(name.IsSymbol()); |
intptr_t num_references = referenced_.length(); |
@@ -489,7 +497,7 @@ SourceLabel* LocalScope::CheckUnresolvedLabels() { |
if (outer_switch == NULL) { |
return label; |
} else { |
- outer_switch->AddLabel(label); |
+ outer_switch->MoveLabel(label); |
} |
} |
} |