Skip to content

Commit aaa8ee7

Browse files
committed
unify code paths
1 parent 42b70f1 commit aaa8ee7

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/fn_call.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,11 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
154154
"__rust_start_panic" | "panic_impl" => {
155155
return err!(MachineError("the evaluated program panicked".to_string()));
156156
}
157-
"exit" => {
157+
"exit" | "ExitProcess" => {
158+
// it's really u32 for ExitProcess, but we have to put it into the `Exit` error variant anyway
158159
let code = this.read_scalar(args[0])?.to_i32()?;
159160
return err!(Exit(code));
160161
}
161-
"ExitProcess" => {
162-
let code = this.read_scalar(args[0])?.to_u32()?;
163-
return err!(Exit(code as i32));
164-
}
165162
_ => if dest.is_none() {
166163
return err!(Unimplemented(
167164
format!("can't call diverging foreign function: {}", link_name),

0 commit comments

Comments
 (0)