parent
42235db0e9
commit
4bf67d99f4
|
@ -474,11 +474,6 @@ void __asan_init() {
|
|||
// Setup internal allocator callback.
|
||||
SetLowLevelAllocateCallback(OnLowLevelAllocate);
|
||||
|
||||
if (flags()->atexit) {
|
||||
Atexit(asan_atexit);
|
||||
}
|
||||
|
||||
// interceptors
|
||||
InitializeAsanInterceptors();
|
||||
|
||||
ReplaceSystemMalloc();
|
||||
|
@ -551,6 +546,10 @@ void __asan_init() {
|
|||
asan_inited = 1;
|
||||
asan_init_is_running = false;
|
||||
|
||||
if (flags()->atexit)
|
||||
Atexit(asan_atexit);
|
||||
|
||||
// interceptors
|
||||
InitTlsSize();
|
||||
|
||||
// Create main thread.
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
// Make sure we don't report a leak nor hang.
|
||||
// RUN: %clangxx_asan -O3 %s -o %t && %t
|
||||
#if defined(__APPLE__)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
int *p = (int*)valloc(1 << 20);
|
||||
int main() { }
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// Make sure we report atexit stats.
|
||||
// RUN: %clangxx_asan -O3 %s -o %t
|
||||
// RUN: ASAN_OPTIONS=atexit=1:print_stats=1 %t 2>&1 | FileCheck %s
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
int *p1 = (int*)malloc(900);
|
||||
int *p2 = (int*)malloc(90000);
|
||||
int *p3 = (int*)malloc(9000000);
|
||||
int main() { }
|
||||
|
||||
// CHECK: AddressSanitizer exit stats:
|
Loading…
Reference in New Issue