reorganize comments for shim's classification

This commit is contained in:
Christian Poveda
2020-02-19 17:03:00 -05:00
parent bc7513bffd
commit 32bc015e35
4 changed files with 10 additions and 5 deletions
+1
View File
@@ -104,6 +104,7 @@ fn emulate_foreign_item_by_name(
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)?;
+1
View File
@@ -40,6 +40,7 @@ fn emulate_foreign_item_by_name(
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}
// Other shims
"pthread_getattr_np" => {
this.write_null(dest)?;
}
+1 -1
View File
@@ -55,7 +55,7 @@ fn emulate_foreign_item_by_name(
this.write_scalar(Scalar::from_int(result, dest.layout.size), dest)?;
}
// macOS API stubs.
// Other shims
"pthread_attr_get_np" => {
this.write_null(dest)?;
}
+7 -4
View File
@@ -16,6 +16,11 @@ fn emulate_foreign_item_by_name(
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 @@ fn emulate_foreign_item_by_name(
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)?;