From 5154b66586c9bfc738ba1976cc36c71784330e06 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 11 Aug 2020 12:38:20 +0200 Subject: [PATCH] only set frame location during push after preamble is done --- src/librustc_mir/interpret/eval_context.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index bcf2899b439..669aecc27ca 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -640,7 +640,7 @@ pub fn push_stack_frame( // first push a stack frame so we have access to the local substs let pre_frame = Frame { body, - loc: Some(mir::Location::START), + loc: None, // `None` for errors generated before we start evaluating. return_to_block, return_place, // empty local array, we fill it in below, after we are inside the stack frame and @@ -683,6 +683,7 @@ pub fn push_stack_frame( } // done self.frame_mut().locals = locals; + self.frame_mut().loc = Some(mir::Location::START); M::after_stack_push(self)?; info!("ENTERING({}) {}", self.frame_idx(), self.frame().instance);