[llvm-commits] [compiler-rt] r161939 - /compiler-rt/trunk/lib/asan/asan_interceptors.cc

Alexander Potapenko glider at google.com
Wed Aug 15 02:46:45 PDT 2012


Author: glider
Date: Wed Aug 15 04:46:45 2012
New Revision: 161939

URL: http://llvm.org/viewvc/llvm-project?rev=161939&view=rev
Log:
Do not attempt to intercept mlock and friends on Windows.

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=161939&r1=161938&r2=161939&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Wed Aug 15 04:46:45 2012
@@ -33,6 +33,7 @@
 # define ASAN_INTERCEPT_STRCASECMP_AND_STRNCASECMP 1
 # define ASAN_INTERCEPT_INDEX 1
 # define ASAN_INTERCEPT_PTHREAD_CREATE 1
+# define ASAN_INTERCEPT_MLOCKX 1
 #else
 # define ASAN_INTERCEPT_ATOLL_AND_STRTOLL 0
 # define ASAN_INTERCEPT__LONGJMP 0
@@ -40,6 +41,7 @@
 # define ASAN_INTERCEPT_STRCASECMP_AND_STRNCASECMP 0
 # define ASAN_INTERCEPT_INDEX 0
 # define ASAN_INTERCEPT_PTHREAD_CREATE 0
+# define ASAN_INTERCEPT_MLOCKX 0
 #endif
 
 #if defined(__linux__)
@@ -131,11 +133,13 @@
 long long strtoll(const char *nptr, char **endptr, int base);  // NOLINT
 # endif
 
+# if ASAN_INTERCEPT_MLOCKX
 // mlock/munlock
 int mlock(const void *addr, size_t len);
 int munlock(const void *addr, size_t len);
 int mlockall(int flags);
 int munlockall(void);
+# endif
 
 // Windows threads.
 # if defined(_WIN32)
@@ -751,11 +755,13 @@
   ASAN_INTERCEPT_FUNC(strtoll);
 #endif
 
+#if ASAN_INTERCEPT_MLOCKX
   // Intercept mlock/munlock.
   ASAN_INTERCEPT_FUNC(mlock);
   ASAN_INTERCEPT_FUNC(munlock);
   ASAN_INTERCEPT_FUNC(mlockall);
   ASAN_INTERCEPT_FUNC(munlockall);
+#endif
 
   // Intecept signal- and jump-related functions.
   ASAN_INTERCEPT_FUNC(longjmp);





More information about the llvm-commits mailing list