Skip to content

Commit 1190a1d

Browse files
committed
"Reland "[hwasan] Provide aliases for c allocation functions for Fuchsia"
This reverts commit c5c6781. This likely broke the android sanitizer builders prior because it accidentally enabled interceptors for android, which they don't use, so c-allocation functions like malloc would go through hwasan. This reland adds the HWASAN_WITH_INTERCEPTORS check.
1 parent 5b07059 commit 1190a1d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler-rt/lib/hwasan/hwasan_allocation_functions.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
#include "interception/interception.h"
1717
#include "sanitizer_common/sanitizer_allocator_dlsym.h"
1818
#include "sanitizer_common/sanitizer_allocator_interface.h"
19+
#include "sanitizer_common/sanitizer_mallinfo.h"
1920
#include "sanitizer_common/sanitizer_tls_get_addr.h"
2021

21-
#if !SANITIZER_FUCHSIA
22-
2322
using namespace __hwasan;
2423

2524
struct DlsymAlloc : public DlSymAllocator<DlsymAlloc> {
@@ -155,10 +154,8 @@ void *__sanitizer_malloc(uptr size) {
155154

156155
} // extern "C"
157156

158-
#if HWASAN_WITH_INTERCEPTORS
157+
#if HWASAN_WITH_INTERCEPTORS || SANITIZER_FUCHSIA
159158
# define INTERCEPTOR_ALIAS(RET, FN, ARGS...) \
160-
extern "C" SANITIZER_INTERFACE_ATTRIBUTE RET WRAP(FN)(ARGS) \
161-
ALIAS("__sanitizer_" #FN); \
162159
extern "C" SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE RET FN( \
163160
ARGS) ALIAS("__sanitizer_" #FN)
164161

@@ -183,5 +180,3 @@ INTERCEPTOR_ALIAS(int, mallopt, int cmd, int value);
183180
INTERCEPTOR_ALIAS(void, malloc_stats, void);
184181
# endif
185182
#endif // #if HWASAN_WITH_INTERCEPTORS
186-
187-
#endif // SANITIZER_FUCHSIA

0 commit comments

Comments
 (0)