diff options
| author | Ralf Jung <post@ralfj.de> | 2020-07-31 20:46:05 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-07-31 20:46:05 +0200 |
| commit | 73ba4e7abe0ada4c187aee4576bffe6024b5098a (patch) | |
| tree | 5fab13a744043735583f03243432f4f30b8df289 /src | |
| parent | 62f9aa94c0d0312544589bed78679d85646d4e62 (diff) | |
| download | rust-73ba4e7abe0ada4c187aee4576bffe6024b5098a.tar.gz rust-73ba4e7abe0ada4c187aee4576bffe6024b5098a.zip | |
Miri: fix ICE when unwinding past topmost stack frame
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index 630b2890835..65736710fce 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -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"); |
