[compiler-rt] r227258 - [ASan] Fix use-after-scope in COMMON_INTERCEPTOR_ENTER implementation.
Alexey Samsonov
vonosmas at gmail.com
Tue Jan 27 14:50:19 PST 2015
Author: samsonov
Date: Tue Jan 27 16:50:19 2015
New Revision: 227258
URL: http://llvm.org/viewvc/llvm-project?rev=227258&view=rev
Log:
[ASan] Fix use-after-scope in COMMON_INTERCEPTOR_ENTER implementation.
Make sure "void *ctx" doesn't point to an object which already went out
of scope. This might also fix -Wuninitialized warnings GCC 4.7 produces
while building ASan runtime.
Modified:
compiler-rt/trunk/lib/asan/asan_interceptors.cc
Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=227258&r1=227257&r2=227258&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Tue Jan 27 16:50:19 2015
@@ -142,10 +142,10 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
#define COMMON_INTERCEPTOR_READ_RANGE(ctx, ptr, size) \
ASAN_READ_RANGE(ctx, ptr, size)
#define COMMON_INTERCEPTOR_ENTER(ctx, func, ...) \
+ ASAN_INTERCEPTOR_ENTER(ctx, func); \
do { \
if (asan_init_is_running) \
return REAL(func)(__VA_ARGS__); \
- ASAN_INTERCEPTOR_ENTER(ctx, func); \
if (SANITIZER_MAC && UNLIKELY(!asan_inited)) \
return REAL(func)(__VA_ARGS__); \
ENSURE_ASAN_INITED(); \
More information about the llvm-commits
mailing list