diff options
| author | Ralf Jung <post@ralfj.de> | 2020-03-09 20:18:48 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-03-09 20:18:48 +0100 |
| commit | 911c75ff5f11c28c9f355857a47c5cd2d73767e7 (patch) | |
| tree | 31f9ab0d6065360bff1713050b0dce92d96ce794 | |
| parent | 8a8870fbae1bf601ac4d29d6c0c407a352caea57 (diff) | |
| download | rust-911c75ff5f11c28c9f355857a47c5cd2d73767e7.tar.gz rust-911c75ff5f11c28c9f355857a47c5cd2d73767e7.zip | |
also handle abort intrinsic with new machine hook
| -rw-r--r-- | src/librustc_mir/interpret/intrinsics.rs | 4 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/machine.rs | 2 | ||||
| -rw-r--r-- | src/librustc_span/symbol.rs | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/intrinsics.rs b/src/librustc_mir/interpret/intrinsics.rs index 891afbf437f..88c6c26c5ba 100644 --- a/src/librustc_mir/interpret/intrinsics.rs +++ b/src/librustc_mir/interpret/intrinsics.rs @@ -103,6 +103,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { self.write_scalar(location.ptr, dest)?; } + sym::abort => { + M::abort(self)?; + } + sym::min_align_of | sym::pref_align_of | sym::needs_drop diff --git a/src/librustc_mir/interpret/machine.rs b/src/librustc_mir/interpret/machine.rs index 64a34fc7dd9..a3c43d7d5d1 100644 --- a/src/librustc_mir/interpret/machine.rs +++ b/src/librustc_mir/interpret/machine.rs @@ -171,7 +171,7 @@ pub trait Machine<'mir, 'tcx>: Sized { ) -> InterpResult<'tcx>; /// Called to evaluate `Abort` MIR terminator. - fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> { + fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx, !> { throw_unsup_format!("aborting execution is not supported"); } diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs index c39f9f360c0..4f5c4de8569 100644 --- a/src/librustc_span/symbol.rs +++ b/src/librustc_span/symbol.rs @@ -120,6 +120,7 @@ symbols! { abi_unadjusted, abi_vectorcall, abi_x86_interrupt, + abort, aborts, address, add_with_overflow, |
