This commit is contained in:
Ralf Jung 2022-06-04 19:43:46 -04:00
parent 92c2e3c0bc
commit 32c03080f1
3 changed files with 6 additions and 1 deletions

View file

@ -1 +1 @@
c35035cefc709abddabfb28ecc6a326458d46ce2
4e725bad73747a4c93a3ac53106e4b4006edc665

View file

@ -18,6 +18,7 @@ impl Dlsym {
pub fn from_str<'tcx>(name: &str) -> InterpResult<'tcx, Option<Dlsym>> {
Ok(match name {
"GetSystemTimePreciseAsFileTime" => None,
"SetThreadDescription" => None,
"NtWriteFile" => Some(Dlsym::NtWriteFile),
_ => throw_unsup_format!("unsupported Windows dlsym: {}", name),
})

View file

@ -415,6 +415,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
// There is only one thread, so this always succeeds and returns TRUE.
this.write_scalar(Scalar::from_i32(1), dest)?;
}
"GetCurrentThread" if this.frame_in_std() => {
let [] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
this.write_scalar(Scalar::from_machine_isize(1, this), dest)?;
}
_ => return Ok(EmulateByNameResult::NotSupported),
}