Skip to content

Commit 3d85362

Browse files
committedNov 5, 2015
[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 llvm-svn: 252161
1 parent 12bba1c commit 3d85362

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎compiler-rt/lib/tsan/rtl/tsan_interceptors.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,11 @@ TSAN_INTERCEPTOR(void*, memcpy, void *dst, const void *src, uptr size) {
630630
}
631631

632632
TSAN_INTERCEPTOR(void*, memmove, void *dst, void *src, uptr n) {
633-
SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
634-
MemoryAccessRange(thr, pc, (uptr)dst, n, true);
635-
MemoryAccessRange(thr, pc, (uptr)src, n, false);
633+
if (!COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) {
634+
SCOPED_TSAN_INTERCEPTOR(memmove, dst, src, n);
635+
MemoryAccessRange(thr, pc, (uptr)dst, n, true);
636+
MemoryAccessRange(thr, pc, (uptr)src, n, false);
637+
}
636638
return REAL(memmove)(dst, src, n);
637639
}
638640

0 commit comments

Comments
 (0)
Please sign in to comment.