diff --git a/pkg/vm/lib/bytecode/gen_bytecode.dart b/pkg/vm/lib/bytecode/gen_bytecode.dart index 894471aa5e8..db0c918f52d 100644 --- a/pkg/vm/lib/bytecode/gen_bytecode.dart +++ b/pkg/vm/lib/bytecode/gen_bytecode.dart @@ -700,6 +700,9 @@ class BytecodeGenerator extends RecursiveVisitor { // BytecodeAssembler eliminates this bytecode if it is unreachable. asm.emitPushNull(); } + if (node.function != null) { + _recordSourcePosition(node.function.fileEndOffset); + } _genReturnTOS(); } } else { @@ -1931,9 +1934,9 @@ class BytecodeGenerator extends RecursiveVisitor { _generateNode(function.body); // BytecodeAssembler eliminates this bytecode if it is unreachable. + _recordSourcePosition(function.fileEndOffset); asm.emitPushNull(); _genReturnTOS(); - _recordSourcePosition(function.fileEndOffset); if (locals.isSyncYieldingFrame) { _genSyncYieldingEpilogue(