[compiler-rt] r252161 - [tsan] Allow memmove interceptor to be used when TSan is not initialized

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 5 06:01:53 PST 2015


Author: kuba.brecka
Date: Thu Nov  5 08:01:53 2015
New Revision: 252161

URL: http://llvm.org/viewvc/llvm-project?rev=252161&view=rev
Log:
[tsan] Allow memmove interceptor to be used when TSan is not initialized

A call to memmove is used early during new thread initialization on OS X. This patch uses the `COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED` check, similarly to how we deal with other early-used interceptors.

Differential Revision: http://reviews.llvm.org/D14377


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc?rev=252161&r1=252160&r2=252161&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_interceptors.cc Thu Nov  5 08:01:53 2015
@@ -630,9 +630,11 @@ TSAN_INTERCEPTOR(void*, memcpy, void *ds
 }
 
 TSAN_INTERCEPTOR(void*, memmove, void *dst, void *src, uptr n) {
-  SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
-  MemoryAccessRange(thr, pc, (uptr)dst, n, true);
-  MemoryAccessRange(thr, pc, (uptr)src, n, false);
+  if (!COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) {
+    SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
+    MemoryAccessRange(thr, pc, (uptr)dst, n, true);
+    MemoryAccessRange(thr, pc, (uptr)src, n, false);
+  }
   return REAL(memmove)(dst, src, n);
 }
 




More information about the llvm-commits mailing list