From ce3721057d4edf48b73de9f002b2ab5bea3d2518 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 24 Dec 2013 12:55:56 +0000 Subject: tsan: remove in_rtl counter This is intended to address the following problem. Episodically we see CHECK-failures when recursive interceptors call back into user code. Effectively we are not "in_rtl" at this point, but it's very complicated and fragile to properly maintain in_rtl property. Instead get rid of it. It was used mostly for sanity CHECKs, which basically never uncover real problems. Instead introduce ignore_interceptors flag, which is used in very few narrow places to disable recursive interceptors (e.g. during runtime initialization). llvm-svn: 197979 --- compiler-rt/lib/tsan/rtl/tsan_vector.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'compiler-rt/lib/tsan/rtl/tsan_vector.h') diff --git a/compiler-rt/lib/tsan/rtl/tsan_vector.h b/compiler-rt/lib/tsan/rtl/tsan_vector.h index fa236b1f1e4..bd2363ff74a 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_vector.h +++ b/compiler-rt/lib/tsan/rtl/tsan_vector.h @@ -58,10 +58,18 @@ class Vector { return begin_[i]; } - T *PushBack(T v = T()) { + T *PushBack() { EnsureSize(Size() + 1); - end_[-1] = v; - return &end_[-1]; + T *p = &end_[-1]; + internal_memset(p, 0, sizeof(*p)); + return p; + } + + T *PushBack(const T& v) { + EnsureSize(Size() + 1); + T *p = &end_[-1]; + internal_memcpy(p, &v, sizeof(*p)); + return p; } void PopBack() { -- cgit v1.2.3