Skip to content

Commit ab00099

Browse files
committed
use throw_machine_stop macro
1 parent c388361 commit ab00099

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/shims/foreign_items.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
154154
"exit" | "ExitProcess" => {
155155
// it's really u32 for ExitProcess, but we have to put it into the `Exit` variant anyway
156156
let code = this.read_scalar(args[0])?.to_i32()?;
157-
let ti = Box::new(TerminationInfo::Exit(code.into()));
158-
return Err(InterpError::MachineStop(ti).into());
157+
throw_machine_stop!(TerminationInfo::Exit(code.into()));
159158
}
160159
_ => {
161160
if let Some(p) = ret {

src/shims/intrinsics.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3434
// Handle diverging intrinsics.
3535
let (dest, ret) = match intrinsic_name {
3636
"abort" => {
37-
let ti = Box::new(TerminationInfo::Abort);
38-
return Err(InterpError::MachineStop(ti).into());
37+
throw_machine_stop!(TerminationInfo::Abort);
3938
}
4039
"miri_start_panic" => return this.handle_miri_start_panic(args, unwind),
4140
_ => {

0 commit comments

Comments
 (0)