summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2009-05-01 20:47:53 +0000
committerStuart Hastings <stuart@apple.com>2009-05-01 20:47:53 +0000
commite54523d56e4203b36ddac6c275bdb51bcdbf09e1 (patch)
tree25c540cf8cad8e161aa9804374d00abc79b4658f /llvm/include
parent8d9c509975053dd33e8b825ecd46ae7804d66791 (diff)
downloadbcm5719-llvm-e54523d56e4203b36ddac6c275bdb51bcdbf09e1.tar.gz
bcm5719-llvm-e54523d56e4203b36ddac6c275bdb51bcdbf09e1.zip
Prevent looping when DenseSet is abused.
llvm-svn: 70572
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/DenseMap.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index 07995d7796c..e18be8963d4 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -346,12 +346,12 @@ private:
// probe almost the entire table until it found the empty bucket. If the
// table completely filled with tombstones, no lookup would ever succeed,
// causing infinite loops in lookup.
+ ++NumEntries;
if (NumEntries*4 >= NumBuckets*3 ||
NumBuckets-(NumEntries+NumTombstones) < NumBuckets/8) {
this->grow(NumBuckets * 2);
LookupBucketFor(Key, TheBucket);
}
- ++NumEntries;
// If we are writing over a tombstone, remember this.
if (!KeyInfoT::isEqual(TheBucket->first, getEmptyKey()))
OpenPOWER on IntegriCloud