Skip to content

Commit 911c75f

Browse files
committed
also handle abort intrinsic with new machine hook
1 parent 8a8870f commit 911c75f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/librustc_mir/interpret/intrinsics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
103103
self.write_scalar(location.ptr, dest)?;
104104
}
105105

106+
sym::abort => {
107+
M::abort(self)?;
108+
}
109+
106110
sym::min_align_of
107111
| sym::pref_align_of
108112
| sym::needs_drop

src/librustc_mir/interpret/machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
171171
) -> InterpResult<'tcx>;
172172

173173
/// Called to evaluate `Abort` MIR terminator.
174-
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {
174+
fn abort(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx, !> {
175175
throw_unsup_format!("aborting execution is not supported");
176176
}
177177

src/librustc_span/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ symbols! {
120120
abi_unadjusted,
121121
abi_vectorcall,
122122
abi_x86_interrupt,
123+
abort,
123124
aborts,
124125
address,
125126
add_with_overflow,

0 commit comments

Comments
 (0)