[compiler-rt] r175629 - [ASan] Make isoc99_*scanf intercepted on Linux only. Those are unavailable on Darwin.
Alexander Potapenko
glider at google.com
Wed Feb 20 07:27:58 PST 2013
Author: glider
Date: Wed Feb 20 09:27:58 2013
New Revision: 175629
URL: http://llvm.org/viewvc/llvm-project?rev=175629&view=rev
Log:
[ASan] Make isoc99_*scanf intercepted on Linux only. Those are unavailable on Darwin.
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=175629&r1=175628&r2=175629&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Feb 20 09:27:58 2013
@@ -266,6 +266,7 @@ VSCANF_INTERCEPTOR_IMPL(vsscanf, true, s
INTERCEPTOR(int, vfscanf, void *stream, const char *format, va_list ap)
VSCANF_INTERCEPTOR_IMPL(vfscanf, true, stream, format, ap)
+#if SANITIZER_INTERCEPT_ISOC99_SCANF
INTERCEPTOR(int, __isoc99_vscanf, const char *format, va_list ap)
VSCANF_INTERCEPTOR_IMPL(__isoc99_vscanf, false, format, ap)
@@ -275,6 +276,7 @@ VSCANF_INTERCEPTOR_IMPL(__isoc99_vsscanf
INTERCEPTOR(int, __isoc99_vfscanf, void *stream, const char *format, va_list ap)
VSCANF_INTERCEPTOR_IMPL(__isoc99_vfscanf, false, stream, format, ap)
+#endif // SANITIZER_INTERCEPT_ISOC99_SCANF
#define SCANF_INTERCEPTOR_IMPL(name, vname, ...) \
{ \
@@ -296,6 +298,7 @@ SCANF_INTERCEPTOR_IMPL(fscanf, vfscanf,
INTERCEPTOR(int, sscanf, const char *str, const char *format, ...)
SCANF_INTERCEPTOR_IMPL(sscanf, vsscanf, str, format)
+#if SANITIZER_INTERCEPT_ISOC99_SCANF
INTERCEPTOR(int, __isoc99_scanf, const char *format, ...)
SCANF_INTERCEPTOR_IMPL(__isoc99_scanf, __isoc99_vscanf, format)
@@ -304,6 +307,7 @@ SCANF_INTERCEPTOR_IMPL(__isoc99_fscanf,
INTERCEPTOR(int, __isoc99_sscanf, const char *str, const char *format, ...)
SCANF_INTERCEPTOR_IMPL(__isoc99_sscanf, __isoc99_vsscanf, str, format)
+#endif
#define INIT_SCANF \
INTERCEPT_FUNCTION(scanf); \
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=175629&r1=175628&r2=175629&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Feb 20 09:27:58 2013
@@ -27,6 +27,12 @@
# define SI_LINUX_NOT_ANDROID 0
#endif
+#if defined(__linux__)
+# define SI_LINUX 1
+#else
+# define SI_LINUX 0
+#endif
+
# define SANITIZER_INTERCEPT_READ SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_PREAD SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_WRITE SI_NOT_WINDOWS
@@ -39,3 +45,4 @@
# define SANITIZER_INTERCEPT_LOCALTIME_AND_FRIENDS SI_NOT_WINDOWS
# define SANITIZER_INTERCEPT_SCANF SI_NOT_WINDOWS
+# define SANITIZER_INTERCEPT_ISOC99_SCANF SI_LINUX
More information about the llvm-commits
mailing list