Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d9c441c

Browse files
committed
put call to stacked borrows end_call in a more sensible place
1 parent c9925ff commit d9c441c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/machine.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
930930
unwinding: bool,
931931
) -> InterpResult<'tcx, StackPopJump> {
932932
let timing = frame.extra.timing.take();
933-
let res = ecx.handle_stack_pop(frame.extra, unwinding);
933+
if let Some(stacked_borrows) = &ecx.machine.stacked_borrows {
934+
stacked_borrows.borrow_mut().end_call(frame.extra.call_id);
935+
}
936+
let res = ecx.handle_stack_pop_unwind(frame.extra, unwinding);
934937
if let Some(profiler) = ecx.machine.profiler.as_ref() {
935938
profiler.finish_recording_interval_event(timing.unwrap());
936939
}

src/shims/panic.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
115115
Ok(())
116116
}
117117

118-
fn handle_stack_pop(
118+
fn handle_stack_pop_unwind(
119119
&mut self,
120120
mut extra: FrameData<'tcx>,
121121
unwinding: bool,
122122
) -> InterpResult<'tcx, StackPopJump> {
123123
let this = self.eval_context_mut();
124-
125-
trace!("handle_stack_pop(extra = {:?}, unwinding = {})", extra, unwinding);
126-
if let Some(stacked_borrows) = &this.machine.stacked_borrows {
127-
stacked_borrows.borrow_mut().end_call(extra.call_id);
128-
}
124+
trace!("handle_stack_pop_unwind(extra = {:?}, unwinding = {})", extra, unwinding);
129125

130126
// We only care about `catch_panic` if we're unwinding - if we're doing a normal
131127
// return, then we don't need to do anything special.

0 commit comments

Comments
 (0)