summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_platform_interceptors.h
diff options
context:
space:
mode:
authorPierre Gousseau <pierregousseau14@gmail.com>2017-05-11 08:53:24 +0000
committerPierre Gousseau <pierregousseau14@gmail.com>2017-05-11 08:53:24 +0000
commitd414238504257845036359ce99e871f6832e7f54 (patch)
tree8f7c891837274a6cb3353d03a007bf6a126d8e5b /lib/sanitizer_common/sanitizer_platform_interceptors.h
parent7ccb9077f2356b7c26c0715f5fd42b4c9c867944 (diff)
[asan] Recommit of r301904: Add strndup/__strndup interceptors
Fix undeclared __interceptor_malloc in esan_interceptors.cc Fix undeclared strnlen on OSX Differential Revision: https://reviews.llvm.org/D31457 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@302781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_platform_interceptors.h')
-rw-r--r--lib/sanitizer_common/sanitizer_platform_interceptors.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
index e5644ef25..a95497467 100644
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -25,6 +25,12 @@
# define SI_NOT_WINDOWS 0
#endif
+#if SANITIZER_POSIX
+# define SI_POSIX 1
+#else
+# define SI_POSIX 0
+#endif
+
#if SANITIZER_LINUX && !SANITIZER_ANDROID
# define SI_LINUX_NOT_ANDROID 1
#else
@@ -69,6 +75,12 @@
# define SI_UNIX_NOT_MAC 0
#endif
+#if SANITIZER_LINUX && !SANITIZER_FREEBSD
+# define SI_LINUX_NOT_FREEBSD 1
+# else
+# define SI_LINUX_NOT_FREEBSD 0
+#endif
+
#define SANITIZER_INTERCEPT_STRLEN 1
#define SANITIZER_INTERCEPT_STRNLEN SI_NOT_MAC
#define SANITIZER_INTERCEPT_STRCMP 1
@@ -86,6 +98,8 @@
#define SANITIZER_INTERCEPT_MEMMOVE 1
#define SANITIZER_INTERCEPT_MEMCPY 1
#define SANITIZER_INTERCEPT_MEMCMP 1
+#define SANITIZER_INTERCEPT_STRNDUP SI_POSIX
+#define SANITIZER_INTERCEPT___STRNDUP SI_LINUX_NOT_FREEBSD
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070
# define SI_MAC_DEPLOYMENT_BELOW_10_7 1