Skip to content

Commit

Permalink
Auto merge of #1093 - RalfJung:throw-machine-stop, r=RalfJung
Browse files Browse the repository at this point in the history
use throw_machine_stop macro

Blocked on rust-lang/rust#66951
  • Loading branch information
bors committed Dec 3, 2019
2 parents c388361 + 07af5c9 commit 6e49f4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f577b0ef6e637ab7a6095cdfe0b51fa3faf97050
7afe6d9d1f48b998cc88fe6f01ba0082788ba4b9
3 changes: 1 addition & 2 deletions src/shims/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
"exit" | "ExitProcess" => {
// it's really u32 for ExitProcess, but we have to put it into the `Exit` variant anyway
let code = this.read_scalar(args[0])?.to_i32()?;
let ti = Box::new(TerminationInfo::Exit(code.into()));
return Err(InterpError::MachineStop(ti).into());
throw_machine_stop!(TerminationInfo::Exit(code.into()));
}
_ => {
if let Some(p) = ret {
Expand Down
3 changes: 1 addition & 2 deletions src/shims/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// Handle diverging intrinsics.
let (dest, ret) = match intrinsic_name {
"abort" => {
let ti = Box::new(TerminationInfo::Abort);
return Err(InterpError::MachineStop(ti).into());
throw_machine_stop!(TerminationInfo::Abort);
}
"miri_start_panic" => return this.handle_miri_start_panic(args, unwind),
_ => {
Expand Down

0 comments on commit 6e49f4a

Please sign in to comment.