diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-12-10 19:24:27 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-12-10 19:24:27 +0000 |
commit | f287377ff9f1d78be5fd09f47cd21dc924add353 (patch) | |
tree | 96965634a01dcae76df6443fce7d30ba9a78b941 /lib/tsan | |
parent | 0a2e74191a075b6c2dbf6a8f8fced20476710630 (diff) |
[TSan] Try harder to avoid compiler-generated memcpy calls.
check_memcpy test added in r254959 fails on some configurations due to
memcpy() calls inserted by Clang. Try harder to avoid them by using
internal_memcpy() where applicable.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/tsan')
-rw-r--r-- | lib/tsan/rtl/tsan_interceptors.cc | 2 | ||||
-rw-r--r-- | lib/tsan/rtl/tsan_symbolize.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/tsan/rtl/tsan_interceptors.cc b/lib/tsan/rtl/tsan_interceptors.cc index 44c5e6359..b157de21a 100644 --- a/lib/tsan/rtl/tsan_interceptors.cc +++ b/lib/tsan/rtl/tsan_interceptors.cc @@ -444,7 +444,7 @@ static void JmpBufGarbageCollect(ThreadState *thr, uptr sp) { JmpBuf *buf = &thr->jmp_bufs[i]; if (buf->sp <= sp) { uptr sz = thr->jmp_bufs.Size(); - thr->jmp_bufs[i] = thr->jmp_bufs[sz - 1]; + internal_memcpy(buf, &thr->jmp_bufs[sz - 1], sizeof(*buf)); thr->jmp_bufs.PopBack(); i--; } diff --git a/lib/tsan/rtl/tsan_symbolize.cc b/lib/tsan/rtl/tsan_symbolize.cc index 51a5d00d3..b24239517 100644 --- a/lib/tsan/rtl/tsan_symbolize.cc +++ b/lib/tsan/rtl/tsan_symbolize.cc @@ -71,7 +71,7 @@ ReportLocation *SymbolizeData(uptr addr) { if (!Symbolizer::GetOrInit()->SymbolizeData(addr, &info)) return 0; ReportLocation *ent = ReportLocation::New(ReportLocationGlobal); - ent->global = info; + internal_memcpy(&ent->global, &info, sizeof(info)); return ent; } |