aboutsummaryrefslogtreecommitdiff
path: root/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-02-22 22:31:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-02-22 22:31:36 +0000
commit7ff616029d1204dc70b7c74438818e53a23e00d5 (patch)
treec80ef9cb2d1e54757027bc3e1b32b98c01ad850c /contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
parent79a79bd7c1f6341471094fceec1e1ff45f62baef (diff)
parent476c4db3dc56bee43df384704c75ccc71cfa7a1d (diff)
Update compiler-rt to trunk r228651. This enables using Address
Sanitizer and Undefined Behavior Sanitizer with clang 3.6.0.
Notes
Notes: svn path=/projects/clang360-import/; revision=279191
Diffstat (limited to 'contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc')
-rw-r--r--contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc b/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
index 7b7b27c024f6..e026217ed171 100644
--- a/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
+++ b/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
@@ -111,12 +111,13 @@ void ThreadContext::OnStarted(void *arg) {
thr->dd_pt = ctx->dd->CreatePhysicalThread();
thr->dd_lt = ctx->dd->CreateLogicalThread(unique_id);
}
+ thr->fast_state.SetHistorySize(flags()->history_size);
+ // Commit switch to the new part of the trace.
+ // TraceAddEvent will reset stack0/mset0 in the new part for us.
+ TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0);
+
thr->fast_synch_epoch = epoch0;
AcquireImpl(thr, 0, &sync);
- thr->fast_state.SetHistorySize(flags()->history_size);
- const uptr trace = (epoch0 / kTracePartSize) % TraceParts();
- Trace *thr_trace = ThreadTrace(thr->tid);
- thr_trace->headers[trace].epoch0 = epoch0;
StatInc(thr, StatSyncAcquire);
sync.Reset(&thr->clock_cache);
DPrintf("#%d: ThreadStart epoch=%zu stk_addr=%zx stk_size=%zx "
@@ -329,7 +330,7 @@ void MemoryAccessRange(ThreadState *thr, uptr pc, uptr addr,
thr->tid, (void*)pc, (void*)addr,
(int)size, is_write);
-#if TSAN_DEBUG
+#if SANITIZER_DEBUG
if (!IsAppMem(addr)) {
Printf("Access to non app mem %zx\n", addr);
DCHECK(IsAppMem(addr));