[PATCH] D22610: [compiler-rt] Fix memmove/memcpy overlap detection on windows

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 08:45:56 PDT 2016


etienneb updated this revision to Diff 64905.
etienneb added a comment.

move to an different approach


https://reviews.llvm.org/D22610

Files:
  lib/asan/asan_interceptors.cc

Index: lib/asan/asan_interceptors.cc
===================================================================
--- lib/asan/asan_interceptors.cc
+++ lib/asan/asan_interceptors.cc
@@ -725,11 +725,12 @@
   InitializeCommonInterceptors();
 
   // Intercept mem* functions.
-  ASAN_INTERCEPT_FUNC(memcpy);
   ASAN_INTERCEPT_FUNC(memset);
+  ASAN_INTERCEPT_FUNC(memmove);
   if (PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE) {
-    // In asan, REAL(memmove) is not used, but it is used in msan.
-    ASAN_INTERCEPT_FUNC(memmove);
+    ASAN_INTERCEPT_FUNC(memcpy);
+  } else {
+    *&REAL(memcpy) = REAL(memmove);
   }
   CHECK(REAL(memcpy));
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22610.64905.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/27345194/attachment.bin>


More information about the llvm-commits mailing list