fix PR sanitizer/58994
From-SVN: r204838
This commit is contained in:
parent
d1c369c21e
commit
c8e1377bf9
2 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
2013-11-15 Kostya Serebryany <kcc@google.com>
|
||||
|
||||
PR sanitizer/58994
|
||||
Backport from upstream revision 194573
|
||||
* asan/asan_interceptors.cc (COMMON_INTERCEPTOR_ENTER): Fall
|
||||
back to the original functions in the common libsanitizer
|
||||
interceptors and the __cxa_atexit() interceptor on Darwin.
|
||||
|
||||
2013-11-13 Peter Bergner <bergner@vnet.ibm.com>
|
||||
|
||||
PR sanitizer/59009
|
||||
|
|
|
@ -106,12 +106,13 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free, void *)
|
|||
#define COMMON_INTERCEPTOR_WRITE_RANGE(ctx, ptr, size) \
|
||||
ASAN_WRITE_RANGE(ptr, size)
|
||||
#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) ASAN_READ_RANGE(ptr, size)
|
||||
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
|
||||
do { \
|
||||
if (asan_init_is_running) return REAL(func)(__VA_ARGS__); \
|
||||
ctx = 0; \
|
||||
(void) ctx; \
|
||||
ENSURE_ASAN_INITED(); \
|
||||
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
|
||||
do { \
|
||||
if (asan_init_is_running) return REAL(func)(__VA_ARGS__); \
|
||||
ctx = 0; \
|
||||
(void) ctx; \
|
||||
if (SANITIZER_MAC && !asan_inited) return REAL(func)(__VA_ARGS__); \
|
||||
ENSURE_ASAN_INITED(); \
|
||||
} while (false)
|
||||
#define COMMON_INTERCEPTOR_FD_ACQUIRE(ctx, fd) \
|
||||
do { \
|
||||
|
@ -634,6 +635,9 @@ static void AtCxaAtexit(void *unused) {
|
|||
#if ASAN_INTERCEPT___CXA_ATEXIT
|
||||
INTERCEPTOR(int, __cxa_atexit, void (*func)(void *), void *arg,
|
||||
void *dso_handle) {
|
||||
#if SANITIZER_MAC
|
||||
if (!asan_inited) return REAL(__cxa_atexit)(func, arg, dso_handle);
|
||||
#endif
|
||||
ENSURE_ASAN_INITED();
|
||||
int res = REAL(__cxa_atexit)(func, arg, dso_handle);
|
||||
REAL(__cxa_atexit)(AtCxaAtexit, 0, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue