diff --git a/src/libpanic_unwind/lib.rs b/src/libpanic_unwind/lib.rs index 4c6c728f6f7..c8d270406c6 100644 --- a/src/libpanic_unwind/lib.rs +++ b/src/libpanic_unwind/lib.rs @@ -97,3 +97,6 @@ pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 { let payload = payload as *mut &mut dyn BoxMeUp; imp::panic(Box::from_raw((*payload).box_me_up())) } + +#[cfg(miri)] +pub fn miri_panic_trampoline() {} diff --git a/src/librustc_mir/interpret/terminator.rs b/src/librustc_mir/interpret/terminator.rs index bed6c5bea54..f77bf56b057 100644 --- a/src/librustc_mir/interpret/terminator.rs +++ b/src/librustc_mir/interpret/terminator.rs @@ -264,10 +264,19 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { match instance.def { ty::InstanceDef::Intrinsic(..) => { + let old_stack = self.cur_frame(); M::call_intrinsic(self, span, instance, args, dest)?; // No stack frame gets pushed, the main loop will just act as if the // call completed. - self.goto_block(ret)?; + if ret.is_some() { + self.goto_block(ret)?; + } else { + // If this intrinsic call doesn't have a ret block, + // then the intrinsic implementation should have + // changed the stack frame (otherwise, we'll end + // up trying to execute this intrinsic call again) + assert!(self.cur_frame() != old_stack); + } if let Some(dest) = dest { self.dump_place(*dest) }