1
Fork 0

interpret/miri: call panic_cannot_unwind lang item instead of hard-coding the same message

This commit is contained in:
Ralf Jung 2023-08-19 13:21:41 +02:00
parent 818ec8e23a
commit 788fd44a3b
14 changed files with 147 additions and 42 deletions

View file

@ -223,6 +223,9 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
throw_unsup_format!("aborting execution is not supported")
}
/// Called when unwinding reached a state where execution should be terminated.
fn unwind_terminate(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx>;
/// Called for all binary operations where the LHS has pointer type.
///
/// Returns a (value, overflowed) pair if the operation succeeded
@ -499,6 +502,11 @@ pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
false
}
#[inline(always)]
fn unwind_terminate(_ecx: &mut InterpCx<$mir, $tcx, Self>) -> InterpResult<$tcx> {
unreachable!("unwinding cannot happen during compile-time evaluation")
}
#[inline(always)]
fn call_extra_fn(
_ecx: &mut InterpCx<$mir, $tcx, Self>,