[compiler-rt] r177155 - [Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h

Alexey Samsonov samsonov at google.com
Fri Mar 15 07:02:21 PDT 2013


Author: samsonov
Date: Fri Mar 15 09:02:21 2013
New Revision: 177155

URL: http://llvm.org/viewvc/llvm-project?rev=177155&view=rev
Log:
[Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h

Modified:
    compiler-rt/trunk/lib/asan/asan_intercepted_functions.h
    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/asan/asan_intercepted_functions.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_intercepted_functions.h?rev=177155&r1=177154&r2=177155&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_intercepted_functions.h (original)
+++ compiler-rt/trunk/lib/asan/asan_intercepted_functions.h Fri Mar 15 09:02:21 2013
@@ -79,9 +79,9 @@ using __sanitizer::uptr;
 # define ASAN_INTERCEPT___CXA_THROW 0
 #endif
 
-// Windows threads.
 # if defined(_WIN32)
 extern "C" {
+// Windows threads.
 __declspec(dllimport)
 void* __stdcall CreateThread(void *sec, uptr st, void* start,
                              void *arg, DWORD fl, DWORD *id);
@@ -103,6 +103,7 @@ int atoi(const char *nptr);
 long atol(const char *nptr);  // NOLINT
 long strtol(const char *nptr, char **endptr, int base);  // NOLINT
 void longjmp(void *env, int value);
+double frexp(double x, int *expptr);
 }
 # endif
 

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=177155&r1=177154&r2=177155&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Fri Mar 15 09:02:21 2013
@@ -37,6 +37,12 @@ INTERCEPTOR(double, frexp, double x, int
   return res;
 }
 
+#define INIT_FREXP INTERCEPT_FUNCTION(frexp);
+#else
+#define INIT_FREXP
+#endif // SANITIZER_INTERCEPT_FREXP
+
+#if SANITIZER_INTERCEPT_FREXPF_FREXPL
 INTERCEPTOR(float, frexpf, float x, int *exp) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, frexpf, x, exp);
@@ -53,13 +59,12 @@ INTERCEPTOR(long double, frexpl, long do
   return res;
 }
 
-#define INIT_FREXP                               \
-  INTERCEPT_FUNCTION(frexp);                     \
+#define INIT_FREXPF_FREXPL                       \
   INTERCEPT_FUNCTION(frexpf);                    \
   INTERCEPT_FUNCTION(frexpl)
 #else
-#define INIT_FREXP
-#endif // SANITIZER_INTERCEPT_FREXP
+#define INIT_FREXPF_FREXPL
+#endif // SANITIZER_INTERCEPT_FREXPF_FREXPL
 
 #if SANITIZER_INTERCEPT_READ
 INTERCEPTOR(SSIZE_T, read, int fd, void *ptr, SIZE_T count) {
@@ -370,4 +375,5 @@ SCANF_INTERCEPTOR_IMPL(__isoc99_sscanf,
   INIT_PWRITE64;                                                               \
   INIT_LOCALTIME_AND_FRIENDS;                                                  \
   INIT_SCANF;                                                                  \
-  INIT_FREXP;
+  INIT_FREXP;                                                                  \
+  INIT_FREXPF_FREXPL;

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=177155&r1=177154&r2=177155&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Fri Mar 15 09:02:21 2013
@@ -48,3 +48,4 @@
 # define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX
 
 # define SANITIZER_INTERCEPT_FREXP 1
+# define SANITIZER_INTERCEPT_FREXPF_FREXPL SI_NOT_WINDOWS





More information about the llvm-commits mailing list