llvm.org GIT mirror llvm / 7b54452
Fix a bug in DenseMap::clear, where we never reset a tombstone to EmptyKey. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40839 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 12 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
9999
100100 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
101101 for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
102 if (P->first != EmptyKey && P->first != TombstoneKey) {
102 if (P->first != EmptyKey) {
103 if (P->first != TombstoneKey) {
104 P->second.~ValueT();
105 --NumEntries;
106 }
103107 P->first = EmptyKey;
104 P->second.~ValueT();
105 --NumEntries;
106108 }
107109 }
108110 assert(NumEntries == 0 && "Node count imbalance!");