From 3baf5b390d5027f8cd652946df0e8cb67b1c794d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 28 Jul 2014 13:54:18 +0000 Subject: [PATCH] tsan: add a useful debug check llvm-svn: 214082 --- compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h b/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h index 2c2e75e..a1cf84b 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h +++ b/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h @@ -65,6 +65,7 @@ class DenseSlabAlloc { } void Free(Cache *c, IndexT idx) { + DCHECK_NE(idx, 0); if (c->pos == Cache::kSize) Drain(c); c->cache[c->pos++] = idx; -- 2.7.4