diff options
| author | The Miri Conjob Bot <miri@cron.bot> | 2023-08-21 05:37:04 +0000 |
|---|---|---|
| committer | The Miri Conjob Bot <miri@cron.bot> | 2023-08-21 05:37:04 +0000 |
| commit | f2fb4633f17144b3b4cb8bb3f6c13fca46333d08 (patch) | |
| tree | ebd6e31fb06e39f241b5e4ae3fac0dcca5a83711 /compiler/rustc_const_eval/src/interpret/eval_context.rs | |
| parent | c05fb4cbf99eea385c4c051fbbc1f652e37a9b08 (diff) | |
| parent | c40cfcf0494ff7506e753e750adb00eeea839f9c (diff) | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/eval_context.rs')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/eval_context.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 3ac6f07e8b7..61d3de5c405 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -765,7 +765,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { } mir::UnwindAction::Terminate => { self.frame_mut().loc = Right(self.frame_mut().body.span); - M::abort(self, "panic in a function that cannot unwind".to_owned())?; + M::unwind_terminate(self)?; + // This might have pushed a new stack frame, or it terminated execution. + // Either way, `loc` will not be updated. + return Ok(()); } }; Ok(()) @@ -865,6 +868,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { panic!("encountered StackPopCleanup::Root when unwinding!") } }; + // This must be the very last thing that happens, since it can in fact push a new stack frame. self.unwind_to_block(unwind) } else { // Follow the normal return edge. |
