diff --git a/cli/src/fuzz/allocations.rs b/cli/src/fuzz/allocations.rs index fed446c6..9d7c91ab 100644 --- a/cli/src/fuzz/allocations.rs +++ b/cli/src/fuzz/allocations.rs @@ -109,7 +109,7 @@ unsafe extern "C" fn ts_record_realloc(ptr: *mut c_void, size: usize) -> *mut c_ let result = realloc(ptr, size); if ptr.is_null() { record_alloc(result); - } else if ptr != result { + } else if !core::ptr::eq(ptr, result) { record_dealloc(ptr); record_alloc(result); } diff --git a/cli/src/tests/helpers/allocations.rs b/cli/src/tests/helpers/allocations.rs index 103cb092..dec67b11 100644 --- a/cli/src/tests/helpers/allocations.rs +++ b/cli/src/tests/helpers/allocations.rs @@ -108,7 +108,7 @@ unsafe extern "C" fn ts_record_realloc(ptr: *mut c_void, size: usize) -> *mut c_ let result = realloc(ptr, size); if ptr.is_null() { record_alloc(result); - } else if ptr != result { + } else if !core::ptr::eq(ptr, result) { record_dealloc(ptr); record_alloc(result); }