reorganize comments for shim's classification
This commit is contained in:
parent
bc7513bffd
commit
32bc015e35
4 changed files with 10 additions and 5 deletions
|
|
@ -104,6 +104,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Other shims
|
||||
"posix_memalign" => {
|
||||
let ret = this.deref_operand(args[0])?;
|
||||
let align = this.read_scalar(args[1])?.to_machine_usize(this)?;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// Other shims
|
||||
"pthread_getattr_np" => {
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
|
||||
}
|
||||
|
||||
// macOS API stubs.
|
||||
// Other shims
|
||||
"pthread_attr_get_np" => {
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
let tcx = &{ this.tcx.tcx };
|
||||
|
||||
match link_name {
|
||||
// Windows API stubs.
|
||||
// HANDLE = isize
|
||||
// DWORD = ULONG = u32
|
||||
// BOOL = i32
|
||||
|
||||
// Environment related shims
|
||||
"GetEnvironmentVariableW" => {
|
||||
// args[0] : LPCWSTR lpName (32-bit ptr to a const string of 16-bit Unicode chars)
|
||||
|
|
@ -70,10 +75,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
dest,
|
||||
)?;
|
||||
}
|
||||
// Windows API stubs.
|
||||
// HANDLE = isize
|
||||
// DWORD = ULONG = u32
|
||||
// BOOL = i32
|
||||
|
||||
// Other shims
|
||||
"GetProcessHeap" => {
|
||||
// Just fake a HANDLE
|
||||
this.write_scalar(Scalar::from_int(1, this.pointer_size()), dest)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue