Skip to content

Commit 5154b66

Browse files
committed
only set frame location during push after preamble is done
1 parent c94ed5c commit 5154b66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
640640
// first push a stack frame so we have access to the local substs
641641
let pre_frame = Frame {
642642
body,
643-
loc: Some(mir::Location::START),
643+
loc: None, // `None` for errors generated before we start evaluating.
644644
return_to_block,
645645
return_place,
646646
// empty local array, we fill it in below, after we are inside the stack frame and
@@ -683,6 +683,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
683683
}
684684
// done
685685
self.frame_mut().locals = locals;
686+
self.frame_mut().loc = Some(mir::Location::START);
686687

687688
M::after_stack_push(self)?;
688689
info!("ENTERING({}) {}", self.frame_idx(), self.frame().instance);

0 commit comments

Comments
 (0)