Skip to content

Commit

Permalink
[tsan] Allow memmove interceptor to be used when TSan is not initialized
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kubamracek committed Nov 5, 2015
1 parent 12bba1c commit 3d85362
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,11 @@ TSAN_INTERCEPTOR(void*, memcpy, void *dst, const void *src, uptr size) {
}

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);
}

Expand Down

0 comments on commit 3d85362

Please sign in to comment.