diff options
| author | Ralf Jung <post@ralfj.de> | 2019-11-16 11:44:32 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-11-16 11:44:32 +0100 |
| commit | 405866aaa3e8057218ad482ca60e284ea0c9e350 (patch) | |
| tree | 259f54665ba57f4c7155fb276151dcf37d1c6fc1 | |
| parent | 1d8b6ce89e0874b5e93c9e41bfdd565c56372bb0 (diff) | |
| download | rust-405866aaa3e8057218ad482ca60e284ea0c9e350.tar.gz rust-405866aaa3e8057218ad482ca60e284ea0c9e350.zip | |
re-add miri intrinsic ABI check
| -rw-r--r-- | src/librustc_mir/interpret/terminator.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/terminator.rs b/src/librustc_mir/interpret/terminator.rs index 4f9e404b2c6..0134c77808b 100644 --- a/src/librustc_mir/interpret/terminator.rs +++ b/src/librustc_mir/interpret/terminator.rs @@ -264,6 +264,11 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { match instance.def { ty::InstanceDef::Intrinsic(..) => { + if caller_abi != Abi::RustIntrinsic && caller_abi != Abi::PlatformIntrinsic { + throw_ub_format!("Rust intrinsic called with an ABI other than \ + `RustIntrinsic` and `PlatformIntrinsic`."); + } + let old_stack = self.cur_frame(); let old_bb = self.frame().block; M::call_intrinsic(self, span, instance, args, dest, ret, unwind)?; |
