summaryrefslogtreecommitdiff
path: root/lib/asan/asan_interceptors.cc
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-03-22 00:52:47 +0000
committerReid Kleckner <rnk@google.com>2016-03-22 00:52:47 +0000
commit71e5da65ab377ff18f49b5480fc982bedb700c48 (patch)
tree0c731576f39504b7bc39765377e406272bc99281 /lib/asan/asan_interceptors.cc
parentdfde1951fa9f3f171e0b48fab96372819f9a094a (diff)
downloadcompiler-rt-71e5da65ab377ff18f49b5480fc982bedb700c48.tar.gz
[asan] Intercept strdup on Windows
Some unit tests were failing because we didn't intercept strdup. It turns out it works just fine on 2013 and 2015 with a small patch to the interception logic. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264013 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_interceptors.cc')
-rw-r--r--lib/asan/asan_interceptors.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/asan/asan_interceptors.cc b/lib/asan/asan_interceptors.cc
index df3d0ed62..914206a22 100644
--- a/lib/asan/asan_interceptors.cc
+++ b/lib/asan/asan_interceptors.cc
@@ -544,7 +544,6 @@ INTERCEPTOR(char*, strcpy, char *to, const char *from) { // NOLINT
return REAL(strcpy)(to, from); // NOLINT
}
-#if ASAN_INTERCEPT_STRDUP
INTERCEPTOR(char*, strdup, const char *s) {
void *ctx;
ASAN_INTERCEPTOR_ENTER(ctx, strdup);
@@ -559,7 +558,6 @@ INTERCEPTOR(char*, strdup, const char *s) {
REAL(memcpy)(new_mem, s, length + 1);
return reinterpret_cast<char*>(new_mem);
}
-#endif
INTERCEPTOR(SIZE_T, wcslen, const wchar_t *s) {
void *ctx;
@@ -729,9 +727,7 @@ void InitializeAsanInterceptors() {
ASAN_INTERCEPT_FUNC(wcslen);
ASAN_INTERCEPT_FUNC(strncat);
ASAN_INTERCEPT_FUNC(strncpy);
-#if ASAN_INTERCEPT_STRDUP
ASAN_INTERCEPT_FUNC(strdup);
-#endif
#if ASAN_INTERCEPT_STRNLEN
ASAN_INTERCEPT_FUNC(strnlen);
#endif