Miri: fix ICE when unwinding past topmost stack frame

This commit is contained in:
Ralf Jung 2020-07-31 20:46:05 +02:00
parent 62f9aa94c0
commit 73ba4e7abe
1 changed files with 4 additions and 0 deletions

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