[compiler-rt] r208693 - [sanitizer] Disable fopen64 interceptor on osx.
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue May 13 05:05:39 PDT 2014
Author: eugenis
Date: Tue May 13 07:05:38 2014
New Revision: 208693
URL: http://llvm.org/viewvc/llvm-project?rev=208693&view=rev
Log:
[sanitizer] Disable fopen64 interceptor on osx.
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=208693&r1=208692&r2=208693&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Tue May 13 07:05:38 2014
@@ -3857,16 +3857,6 @@ INTERCEPTOR(__sanitizer_FILE *, fopen, c
if (res) unpoison_file(res);
return res;
}
-INTERCEPTOR(__sanitizer_FILE *, fopen64, const char *path, const char *mode) {
- void *ctx;
- COMMON_INTERCEPTOR_ENTER(ctx, fopen64, path, mode);
- COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
- COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1);
- __sanitizer_FILE *res = REAL(fopen64)(path, mode);
- COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
- if (res) unpoison_file(res);
- return res;
-}
INTERCEPTOR(__sanitizer_FILE *, fdopen, int fd, const char *mode) {
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, fdopen, fd, mode);
@@ -3887,6 +3877,25 @@ INTERCEPTOR(__sanitizer_FILE *, freopen,
if (res) unpoison_file(res);
return res;
}
+#define INIT_FOPEN \
+ COMMON_INTERCEPT_FUNCTION(fopen); \
+ COMMON_INTERCEPT_FUNCTION(fdopen); \
+ COMMON_INTERCEPT_FUNCTION(freopen);
+#else
+#define INIT_FOPEN
+#endif
+
+#if SANITIZER_INTERCEPT_FOPEN64
+INTERCEPTOR(__sanitizer_FILE *, fopen64, const char *path, const char *mode) {
+ void *ctx;
+ COMMON_INTERCEPTOR_ENTER(ctx, fopen64, path, mode);
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, mode, REAL(strlen)(mode) + 1);
+ __sanitizer_FILE *res = REAL(fopen64)(path, mode);
+ COMMON_INTERCEPTOR_FILE_OPEN(ctx, res, path);
+ if (res) unpoison_file(res);
+ return res;
+}
INTERCEPTOR(__sanitizer_FILE *, freopen64, const char *path, const char *mode,
__sanitizer_FILE *fp) {
void *ctx;
@@ -3899,14 +3908,11 @@ INTERCEPTOR(__sanitizer_FILE *, freopen6
if (res) unpoison_file(res);
return res;
}
-#define INIT_FOPEN \
- COMMON_INTERCEPT_FUNCTION(fopen); \
+#define INIT_FOPEN64 \
COMMON_INTERCEPT_FUNCTION(fopen64); \
- COMMON_INTERCEPT_FUNCTION(fdopen); \
- COMMON_INTERCEPT_FUNCTION(freopen); \
COMMON_INTERCEPT_FUNCTION(freopen64);
#else
-#define INIT_FOPEN
+#define INIT_FOPEN64
#endif
#if SANITIZER_INTERCEPT_OPEN_MEMSTREAM
@@ -4169,6 +4175,7 @@ static void InitializeCommonInterceptors
INIT_TSEARCH;
INIT_LIBIO_INTERNALS;
INIT_FOPEN;
+ INIT_FOPEN64;
INIT_OPEN_MEMSTREAM;
INIT_OBSTACK;
INIT_FFLUSH;
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=208693&r1=208692&r2=208693&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Tue May 13 07:05:38 2014
@@ -198,6 +198,7 @@
#define SANITIZER_INTERCEPT_TSEARCH SI_LINUX_NOT_ANDROID || SI_MAC
#define SANITIZER_INTERCEPT_LIBIO_INTERNALS SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_FOPEN SI_NOT_WINDOWS
+#define SANITIZER_INTERCEPT_FOPEN64 SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_OPEN_MEMSTREAM SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_OBSTACK SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_FFLUSH SI_NOT_WINDOWS
More information about the llvm-commits
mailing list