tsan: add a useful debug check
authorDmitry Vyukov <dvyukov@google.com>
Mon, 28 Jul 2014 13:54:18 +0000 (13:54 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Mon, 28 Jul 2014 13:54:18 +0000 (13:54 +0000)
llvm-svn: 214082

compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h

index 2c2e75e..a1cf84b 100644 (file)
@@ -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;