Skip to content

Commit bc8b6fb

Browse files
alexmarkovcommit-bot@chromium.org
authored andcommitted
[vm/bytecode] Fix last source position in a function
Change-Id: Id3b9c6476cc3745a39a7010b7ae09d2422467e31 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107182 Reviewed-by: Régis Crelier <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent efc85ca commit bc8b6fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pkg/vm/lib/bytecode/gen_bytecode.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
700700
// BytecodeAssembler eliminates this bytecode if it is unreachable.
701701
asm.emitPushNull();
702702
}
703+
if (node.function != null) {
704+
_recordSourcePosition(node.function.fileEndOffset);
705+
}
703706
_genReturnTOS();
704707
}
705708
} else {
@@ -1931,9 +1934,9 @@ class BytecodeGenerator extends RecursiveVisitor<Null> {
19311934
_generateNode(function.body);
19321935

19331936
// BytecodeAssembler eliminates this bytecode if it is unreachable.
1937+
_recordSourcePosition(function.fileEndOffset);
19341938
asm.emitPushNull();
19351939
_genReturnTOS();
1936-
_recordSourcePosition(function.fileEndOffset);
19371940

19381941
if (locals.isSyncYieldingFrame) {
19391942
_genSyncYieldingEpilogue(

0 commit comments

Comments
 (0)