From aaa8ee743bca78d52018a025a525183405b2a1b1 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 22 Apr 2019 13:20:51 +0200 Subject: [PATCH] unify code paths --- src/fn_call.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/fn_call.rs b/src/fn_call.rs index 62ad675218a..29a34a69686 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -154,14 +154,11 @@ fn emulate_foreign_item( "__rust_start_panic" | "panic_impl" => { return err!(MachineError("the evaluated program panicked".to_string())); } - "exit" => { + "exit" | "ExitProcess" => { + // it's really u32 for ExitProcess, but we have to put it into the `Exit` error variant anyway let code = this.read_scalar(args[0])?.to_i32()?; return err!(Exit(code)); } - "ExitProcess" => { - let code = this.read_scalar(args[0])?.to_u32()?; - return err!(Exit(code as i32)); - } _ => if dest.is_none() { return err!(Unimplemented( format!("can't call diverging foreign function: {}", link_name), -- 2.44.0