Skip to content

Commit da4e6eb

Browse files
alexmarkovcommit-bot@chromium.org
authored andcommitted
[vm/bytecode] Correct source positions for for-in statements
Fixes service/next_through_for_each_loop_test in bytecode mode. Change-Id: Ida3269f3ca6127b088855f173bd8a2e18faf884d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114553 Reviewed-by: Régis Crelier <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent a7666c4 commit da4e6eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/vm/lib/bytecode/gen_bytecode.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,7 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
34133413

34143414
// Front-end inserts implicit cast (type check) which ensures that
34153415
// result of iterable expression is Iterable<dynamic>.
3416+
_recordSourcePosition(node.iterable.fileOffset);
34163417
asm.emitInterfaceCall(
34173418
cp.addInterfaceCall(InvocationKind.getter, iterableIterator,
34183419
objectTable.getArgDescHandle(1)),
@@ -3454,6 +3455,7 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
34543455
_genJumpIfFalse(/* negated = */ false, done);
34553456

34563457
_enterScope(node);
3458+
_recordSourcePosition(node.bodyOffset);
34573459

34583460
_genPushContextIfCaptured(node.variable);
34593461

0 commit comments

Comments
 (0)