[compiler-rt] r276311 - fix https://reviews.llvm.org/D22610

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 10:58:04 PDT 2016


Author: etienneb
Date: Thu Jul 21 12:58:04 2016
New Revision: 276311

URL: http://llvm.org/viewvc/llvm-project?rev=276311&view=rev
Log:
fix https://reviews.llvm.org/D22610
AppleClang can't compile the assignment expression.

Modified:
    compiler-rt/trunk/lib/asan/asan_interceptors.cc
    compiler-rt/trunk/lib/interception/interception.h

Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=276311&r1=276310&r2=276311&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Thu Jul 21 12:58:04 2016
@@ -730,7 +730,7 @@ void InitializeAsanInterceptors() {
   if (PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE) {
     ASAN_INTERCEPT_FUNC(memcpy);
   } else {
-    REAL(memcpy) = REAL(memmove);
+    ASSIGN_REAL(memcpy, memmove);
   }
   CHECK(REAL(memcpy));
 

Modified: compiler-rt/trunk/lib/interception/interception.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/interception/interception.h?rev=276311&r1=276310&r2=276311&view=diff
==============================================================================
--- compiler-rt/trunk/lib/interception/interception.h (original)
+++ compiler-rt/trunk/lib/interception/interception.h Thu Jul 21 12:58:04 2016
@@ -158,10 +158,13 @@ const interpose_substitution substitutio
     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, ...) \




More information about the llvm-commits mailing list