Skip to content

Commit bb397c4

Browse files
authored
Rollup merge of rust-lang#74984 - RalfJung:miri-unwind-top, r=oli-obk
Miri: fix ICE when unwinding past topmost stack frame Fixes rust-lang/miri#1389
2 parents 5434142 + 73ba4e7 commit bb397c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/eval_context.rs

+4
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
718718
}
719719
);
720720

721+
if unwinding && self.frame_idx() == 0 {
722+
throw_ub_format!("unwinding past the topmost frame of the stack");
723+
}
724+
721725
::log_settings::settings().indentation -= 1;
722726
let frame =
723727
self.stack_mut().pop().expect("tried to pop a stack frame, but there were none");

0 commit comments

Comments
 (0)