Add miri trampoline, fix handling of intrinsic return
This commit is contained in:
parent
5553476d49
commit
b06c83c200
@ -97,3 +97,6 @@
|
||||
let payload = payload as *mut &mut dyn BoxMeUp;
|
||||
imp::panic(Box::from_raw((*payload).box_me_up()))
|
||||
}
|
||||
|
||||
#[cfg(miri)]
|
||||
pub fn miri_panic_trampoline() {}
|
||||
|
@ -264,10 +264,19 @@ fn eval_fn_call(
|
||||
|
||||
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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user