Rollup merge of #74984 - RalfJung:miri-unwind-top, r=oli-obk
Miri: fix ICE when unwinding past topmost stack frame Fixes https://github.com/rust-lang/miri/issues/1389
This commit is contained in:
commit
bb397c465c
1 changed files with 4 additions and 0 deletions
|
@ -718,6 +718,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
}
|
||||
);
|
||||
|
||||
if unwinding && self.frame_idx() == 0 {
|
||||
throw_ub_format!("unwinding past the topmost frame of the stack");
|
||||
}
|
||||
|
||||
::log_settings::settings().indentation -= 1;
|
||||
let frame =
|
||||
self.stack_mut().pop().expect("tried to pop a stack frame, but there were none");
|
||||
|
|
Loading…
Reference in a new issue