use throw_machine_stop macro
This commit is contained in:
parent
c388361cc2
commit
ab000997db
@ -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 {
|
||||
|
@ -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),
|
||||
_ => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user