Index: runtime/vm/flow_graph_builder.cc |
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc |
index 959b4101de2cb160970d48c8170208d5004be4c9..98dabb2adce53b575c996bfb3c0ef0e242e1a282 100644 |
--- a/runtime/vm/flow_graph_builder.cc |
+++ b/runtime/vm/flow_graph_builder.cc |
@@ -3881,8 +3881,12 @@ void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) { |
// if we inline or not. |
if (!function.IsImplicitGetterFunction() && |
!function.IsImplicitSetterFunction()) { |
+ // We want the stack overlow error to be reported at the opening '{' or |
+ // at the '=>' location. So, we get the sequence node corresponding to the |
+ // body inside |node| and use its token position. |
+ ASSERT(node->length() > 0); |
CheckStackOverflowInstr* check = new (Z) CheckStackOverflowInstr( |
- node->token_pos(), 0, owner()->GetNextDeoptId()); |
+ node->NodeAt(0)->token_pos(), 0, owner()->GetNextDeoptId()); |
// If we are inlining don't actually attach the stack check. We must still |
// create the stack check in order to allocate a deopt id. |
if (!owner()->IsInlining()) { |