Skip to content

Commit 49a8f00

Browse files
author
hyd-dev
committed
let-bind exp_abi of "exit" | "ExitProcess"
1 parent e46aab5 commit 49a8f00

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/shims/foreign_items.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
238238
| "exit"
239239
| "ExitProcess"
240240
=> {
241-
let &[ref code] = this.check_shim(abi, if link_name == "exit" { Abi::C { unwind: false } } else { Abi::System { unwind: false } }, link_name_sym, args)?;
241+
let exp_abi = if link_name == "exit" {
242+
Abi::C { unwind: false }
243+
} else {
244+
Abi::System { unwind: false }
245+
};
246+
let &[ref code] = this.check_shim(abi, exp_abi, link_name_sym, args)?;
242247
// it's really u32 for ExitProcess, but we have to put it into the `Exit` variant anyway
243248
let code = this.read_scalar(code)?.to_i32()?;
244249
throw_machine_stop!(TerminationInfo::Exit(code.into()));

0 commit comments

Comments
 (0)