[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
This commit is contained in:
Kuba Brecka 2015-11-05 14:01:53 +00:00
parent 12bba1c2a0
commit 3d8536240a
1 changed files with 5 additions and 3 deletions

View File

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