Skip to content

Commit 3ab3671

Browse files
committed
[hwasan] RunMallocHooks with orig_size
This matches behaviour of asan. sanitizer_common/TestCases/malloc_hook.cpp should've caught this- but hwasan was on XFAIL. Differential Revision: https://reviews.llvm.org/D151580
1 parent 7ebf64f commit 3ab3671

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

compiler-rt/lib/hwasan/hwasan_allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static void *HwasanAllocate(StackTrace *stack, uptr orig_size, uptr alignment,
265265
: __lsan::kDirectlyLeaked);
266266
#endif
267267
meta->SetAllocated(StackDepotPut(*stack), orig_size);
268-
RunMallocHooks(user_ptr, size);
268+
RunMallocHooks(user_ptr, orig_size);
269269
return user_ptr;
270270
}
271271

compiler-rt/test/sanitizer_common/TestCases/malloc_hook.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// Must not be implemented, no other reason to install interceptors.
77
// XFAIL: ubsan
88

9-
// FIXME: Implement.
10-
// XFAIL: hwasan
11-
129
#include <stdlib.h>
1310
#include <unistd.h>
1411
#include <sanitizer/allocator_interface.h>

compiler-rt/test/sanitizer_common/TestCases/malloc_hook_get_allocated_size_fast.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
// Must not be implemented, no other reason to install interceptors.
77
// XFAIL: ubsan
88

9-
// FIXME: Implement.
10-
// XFAIL: hwasan
11-
129
#include <assert.h>
1310
#include <sanitizer/allocator_interface.h>
1411
#include <stdlib.h>

0 commit comments

Comments
 (0)