summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_interceptors.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2011-12-28 01:08:14 +0000
committerKostya Serebryany <kcc@google.com>2011-12-28 01:08:14 +0000
commit8b981c25642d3a4319c52aa906a4f45c63f8143e (patch)
tree6cc210f6cac749e8a47a8b28d04ca679dd6405e5 /compiler-rt/lib/asan/asan_interceptors.h
parent46c70d33d7b6ece449093d5afa7d7d10b7d1c1ed (diff)
downloadbcm5719-llvm-8b981c25642d3a4319c52aa906a4f45c63f8143e.tar.gz
bcm5719-llvm-8b981c25642d3a4319c52aa906a4f45c63f8143e.zip
The code instrumented with ASan may have its own instance of the
mach_override library. In this case chances are that functions from it will be called from mach_override_ptr() during ASan initialization. This may lead to crashes (if those functions are instrumented) or incorrect behavior (if the implementations differ). The attached patch renames mach_override_ptr() into __asan_mach_override_ptr() and makes the rest of the mach_override internals hidden. The corresponding AddressSanitizer bug is http://code.google.com/p/address-sanitizer/issues/detail?id=22 Patch by glider@google.com llvm-svn: 147303
Diffstat (limited to 'compiler-rt/lib/asan/asan_interceptors.h')
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.h b/compiler-rt/lib/asan/asan_interceptors.h
index 39b66fec72a..20a2688f561 100644
--- a/compiler-rt/lib/asan/asan_interceptors.h
+++ b/compiler-rt/lib/asan/asan_interceptors.h
@@ -39,15 +39,15 @@
#define WRAPPER_NAME(x) "wrap_"#x
#define OVERRIDE_FUNCTION(oldfunc, newfunc) \
- CHECK(0 == mach_override_ptr((void*)(oldfunc), \
- (void*)(newfunc), \
- (void**)&real_##oldfunc)); \
+ CHECK(0 == __asan_mach_override_ptr((void*)(oldfunc), \
+ (void*)(newfunc), \
+ (void**)&real_##oldfunc)); \
CHECK(real_##oldfunc != NULL);
#define OVERRIDE_FUNCTION_IF_EXISTS(oldfunc, newfunc) \
- do { mach_override_ptr((void*)(oldfunc), \
- (void*)(newfunc), \
- (void**)&real_##oldfunc); } while (0)
+ do { __asan_mach_override_ptr((void*)(oldfunc), \
+ (void*)(newfunc), \
+ (void**)&real_##oldfunc); } while (0)
#define INTERCEPT_FUNCTION(func) \
OVERRIDE_FUNCTION(func, WRAP(func))
OpenPOWER on IntegriCloud