mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
make ExitProcess Windows-only
This commit is contained in:
parent
85e061af8f
commit
745e3f224c
@ -405,14 +405,8 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Aborting the process.
|
// Aborting the process.
|
||||||
"exit" | "ExitProcess" => {
|
"exit" => {
|
||||||
let exp_abi = if link_name.as_str() == "exit" {
|
let [code] = this.check_shim(abi, Abi::C { unwind: false }, link_name, args)?;
|
||||||
Abi::C { unwind: false }
|
|
||||||
} else {
|
|
||||||
Abi::System { unwind: false }
|
|
||||||
};
|
|
||||||
let [code] = this.check_shim(abi, exp_abi, link_name, args)?;
|
|
||||||
// it's really u32 for ExitProcess, but we have to put it into the `Exit` variant anyway
|
|
||||||
let code = this.read_scalar(code)?.to_i32()?;
|
let code = this.read_scalar(code)?.to_i32()?;
|
||||||
throw_machine_stop!(TerminationInfo::Exit { code: code.into(), leak_check: false });
|
throw_machine_stop!(TerminationInfo::Exit { code: code.into(), leak_check: false });
|
||||||
}
|
}
|
||||||
|
@ -506,6 +506,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
|
"ExitProcess" => {
|
||||||
|
let [code] =
|
||||||
|
this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
|
||||||
|
let code = this.read_scalar(code)?.to_u32()?;
|
||||||
|
throw_machine_stop!(TerminationInfo::Exit { code: code.into(), leak_check: false });
|
||||||
|
}
|
||||||
"SystemFunction036" => {
|
"SystemFunction036" => {
|
||||||
// This is really 'RtlGenRandom'.
|
// This is really 'RtlGenRandom'.
|
||||||
let [ptr, len] =
|
let [ptr, len] =
|
||||||
|
Loading…
Reference in New Issue
Block a user