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:
Yuki Okushi 2020-08-01 08:02:09 +09:00 committed by GitHub
commit bb397c465c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");