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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1768763002: Fix context level info in for-loops (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | runtime/vm/object.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 c5460be9ff01b152ae9b246658cd9b9bb40edf5c..4bf3ec999cf74a8a5df01081991a6e97871525bc 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2176,8 +2176,13 @@ void EffectGraphVisitor::VisitForNode(ForNode* node) {
}
Goto(loop_entry);
exit_ = loop_entry;
+ // Note: the stack overflow check happens on the back branch that jumps
+ // to the increment instruction. The token position for the overflow
+ // check must match the position of the increment expression, so that
+ // the context level (if any) matches the that of the increment
+ // expression.
AddInstruction(
- new(Z) CheckStackOverflowInstr(node->token_pos(),
+ new(Z) CheckStackOverflowInstr(node->increment()->token_pos(),
owner()->loop_depth()));
}
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698