Skip to content

Commit

Permalink
also handle abort intrinsic with new machine hook
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 9, 2020
1 parent 8a8870f commit 911c75f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/librustc_mir/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_span/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ symbols! {
abi_unadjusted,
abi_vectorcall,
abi_x86_interrupt,
abort,
aborts,
address,
add_with_overflow,
Expand Down

0 comments on commit 911c75f

Please sign in to comment.