Skip to content

Commit 405866a

Browse files
committed
re-add miri intrinsic ABI check
1 parent 1d8b6ce commit 405866a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustc_mir/interpret/terminator.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
264264

265265
match instance.def {
266266
ty::InstanceDef::Intrinsic(..) => {
267+
if caller_abi != Abi::RustIntrinsic && caller_abi != Abi::PlatformIntrinsic {
268+
throw_ub_format!("Rust intrinsic called with an ABI other than \
269+
`RustIntrinsic` and `PlatformIntrinsic`.");
270+
}
271+
267272
let old_stack = self.cur_frame();
268273
let old_bb = self.frame().block;
269274
M::call_intrinsic(self, span, instance, args, dest, ret, unwind)?;

0 commit comments

Comments
 (0)