From 3bbdddf527c762085802544665d6e77471ea035b Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Sat, 22 Sep 2012 01:24:16 +0000 Subject: [PATCH] DenseMap: assert that we have found a bucket before we try to insert into it. This silences literally dozens of analyzer warnings on LLVM (since DenseMap is such a commonly-used class). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164438 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/DenseMap.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index f60d688c0dc..cbcf7892c97 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -423,6 +423,7 @@ private: this->grow(NumBuckets); LookupBucketFor(Key, TheBucket); } + assert(TheBucket); // Only update the state after we've grown our bucket space appropriately // so that when growing buckets we have self-consistent entry count. -- 2.34.1