about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-03-09 20:18:48 +0100
committerRalf Jung <post@ralfj.de>2020-03-09 20:18:48 +0100
commit911c75ff5f11c28c9f355857a47c5cd2d73767e7 (patch)
tree31f9ab0d6065360bff1713050b0dce92d96ce794
parent8a8870fbae1bf601ac4d29d6c0c407a352caea57 (diff)
downloadrust-911c75ff5f11c28c9f355857a47c5cd2d73767e7.tar.gz
rust-911c75ff5f11c28c9f355857a47c5cd2d73767e7.zip
also handle abort intrinsic with new machine hook
-rw-r--r--src/librustc_mir/interpret/intrinsics.rs4
-rw-r--r--src/librustc_mir/interpret/machine.rs2
-rw-r--r--src/librustc_span/symbol.rs1
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,