Skip to content

Commit 73ba4e7

Browse files
committed
Miri: fix ICE when unwinding past topmost stack frame
1 parent 62f9aa9 commit 73ba4e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: 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)