Skip to content

Commit

Permalink
Miri: fix ICE when unwinding past topmost stack frame
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 31, 2020
1 parent 62f9aa9 commit 73ba4e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_mir/interpret/eval_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 73ba4e7

Please sign in to comment.