Skip to content

Commit 53f5943

Browse files
committed
fix HeapFree return value
1 parent d301416 commit 53f5943

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fn_call.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
722722
// Windows API stubs.
723723
// HANDLE = isize
724724
// DWORD = ULONG = u32
725+
// BOOL = i32
725726
"GetProcessHeap" => {
726727
// Just fake a HANDLE
727728
this.write_scalar(Scalar::from_int(1, this.pointer_size()), dest)?;
@@ -739,6 +740,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
739740
let _flags = this.read_scalar(args[1])?.to_u32()?;
740741
let ptr = this.read_scalar(args[2])?.not_undef()?;
741742
this.free(ptr)?;
743+
this.write_scalar(Scalar::from_int(1, Size::from_bytes(4)), dest)?;
742744
}
743745
"HeapReAlloc" => {
744746
let _handle = this.read_scalar(args[0])?.to_isize(this)?;

0 commit comments

Comments
 (0)