From: Jordan Rose Date: Sat, 22 Sep 2012 01:24:16 +0000 (+0000) Subject: DenseMap: assert that we have found a bucket before we try to insert into it. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=3bbdddf527c762085802544665d6e77471ea035b;p=oota-llvm.git 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 --- 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.