diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-07-22 23:02:34 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-07-22 23:02:34 +0000 |
commit | 5e3c08db79b36706165982e6ff0311c67a671c33 (patch) | |
tree | 1eb159bc4fc6886e3aaf0b633d00f8d4964505fb | |
parent | 3aeb91b7f970d35265202300b37cc5ca7806422e (diff) |
Revert "fix https://reviews.llvm.org/D22610" and "[compiler-rt] Fix memmove/memcpy overlap detection on windows"
This currently fails ~500 tests on Darwin:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/20456/
This reverts commit 4cfee0dff1facb8fa2827d25c5943bfef96d1a8f and
dbd91205d578cb61ab77be06087e9f65ba8a7ec8.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@276490 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/asan/asan_interceptors.cc | 7 | ||||
-rw-r--r-- | lib/asan/tests/asan_str_test.cc | 2 | ||||
-rw-r--r-- | lib/interception/interception.h | 3 |
3 files changed, 3 insertions, 9 deletions
diff --git a/lib/asan/asan_interceptors.cc b/lib/asan/asan_interceptors.cc index faa75a40a..518ceebf6 100644 --- a/lib/asan/asan_interceptors.cc +++ b/lib/asan/asan_interceptors.cc @@ -725,12 +725,11 @@ void InitializeAsanInterceptors() { InitializeCommonInterceptors(); // Intercept mem* functions. + ASAN_INTERCEPT_FUNC(memcpy); ASAN_INTERCEPT_FUNC(memset); - ASAN_INTERCEPT_FUNC(memmove); if (PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE) { - ASAN_INTERCEPT_FUNC(memcpy); - } else { - ASSIGN_REAL(memcpy, memmove); + // In asan, REAL(memmove) is not used, but it is used in msan. + ASAN_INTERCEPT_FUNC(memmove); } CHECK(REAL(memcpy)); diff --git a/lib/asan/tests/asan_str_test.cc b/lib/asan/tests/asan_str_test.cc index 8173294a2..dd755875e 100644 --- a/lib/asan/tests/asan_str_test.cc +++ b/lib/asan/tests/asan_str_test.cc @@ -456,7 +456,6 @@ TEST(AddressSanitizer, StrArgsOverlapTest) { // memmove(). #if !defined(__APPLE__) || !defined(MAC_OS_X_VERSION_10_7) || \ (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7) -#if PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE // Check "memcpy". Use Ident() to avoid inlining. memset(str, 'z', size); Ident(memcpy)(str + 1, str + 11, 10); @@ -464,7 +463,6 @@ TEST(AddressSanitizer, StrArgsOverlapTest) { EXPECT_DEATH(Ident(memcpy)(str, str + 14, 15), OverlapErrorMessage("memcpy")); EXPECT_DEATH(Ident(memcpy)(str + 14, str, 15), OverlapErrorMessage("memcpy")); #endif -#endif // We do not treat memcpy with to==from as a bug. // See http://llvm.org/bugs/show_bug.cgi?id=11763. diff --git a/lib/interception/interception.h b/lib/interception/interception.h index 5885e103c..9e9aca215 100644 --- a/lib/interception/interception.h +++ b/lib/interception/interception.h @@ -158,13 +158,10 @@ const interpose_substitution substitution_##func_name[] \ namespace __interception { \ extern FUNC_TYPE(func) PTR_TO_REAL(func); \ } -# define ASSIGN_REAL(dst, src) REAL(dst) = REAL(src) #else // __APPLE__ # define REAL(x) x # define DECLARE_REAL(ret_type, func, ...) \ extern "C" ret_type func(__VA_ARGS__); -// This is not working on Apple. -# define ASSIGN_REAL(x, y) CHECK(false) #endif // __APPLE__ #define DECLARE_REAL_AND_INTERCEPTOR(ret_type, func, ...) \ |