Skip to content

Commit 0c59340

Browse files
committed
Don't check HEAP in miri.
1 parent 7c1548d commit 0c59340

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/std/src/sys/pal/windows/alloc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ struct Header(*mut u8);
125125
unsafe fn allocate(layout: Layout, zeroed: bool) -> *mut u8 {
126126
// SAFETY: Check the pointer here.
127127
let heap = unsafe { get_process_heap() };
128+
// Initializer is not called in miri, and it's OK to continue with null.
129+
#[cfg(not(miri))]
128130
if heap.is_null() {
129131
// Allocation has failed, could not get the current process heap.
130132
return ptr::null_mut();

0 commit comments

Comments
 (0)