forked from OSchip/llvm-project
Make __asan::asan_{malloc,free,memalign} globally visible, so that the dynamic version of the runtime will export them.
llvm-svn: 161942
This commit is contained in:
parent
9fe914b099
commit
55df945db2
|
@ -810,17 +810,20 @@ static inline void ASAN_DELETE_HOOK(void *ptr) { }
|
|||
|
||||
namespace __asan {
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
void *asan_memalign(uptr alignment, uptr size, AsanStackTrace *stack) {
|
||||
void *ptr = (void*)Allocate(alignment, size, stack);
|
||||
ASAN_NEW_HOOK(ptr, size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
void asan_free(void *ptr, AsanStackTrace *stack) {
|
||||
ASAN_DELETE_HOOK(ptr);
|
||||
Deallocate((u8*)ptr, stack);
|
||||
}
|
||||
|
||||
__attribute__((visibility("default")))
|
||||
void *asan_malloc(uptr size, AsanStackTrace *stack) {
|
||||
void *ptr = (void*)Allocate(0, size, stack);
|
||||
ASAN_NEW_HOOK(ptr, size);
|
||||
|
|
Loading…
Reference in New Issue