summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2012-10-23 18:47:35 +0000
committerPete Cooper <peter_cooper@apple.com>2012-10-23 18:47:35 +0000
commitfbaf206f470b5a6a54811547641ee41368a2cccd (patch)
tree66121671838185f2576d1cec6b83587cfbeecb91 /include
parent6457001f31713ff26a707ddef616341052b1b296 (diff)
downloadllvm-fbaf206f470b5a6a54811547641ee41368a2cccd.tar.gz
llvm-fbaf206f470b5a6a54811547641ee41368a2cccd.tar.bz2
llvm-fbaf206f470b5a6a54811547641ee41368a2cccd.tar.xz
Fixed bug in SmallDenseMap where it wouldn't leave enough space for an empty bucket if the number of values was exactly equal to the small capacity. This led to an infinite loop when finding a non-existent element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166492 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/DenseMap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index cbcf7892c9..0ae54f4292 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -826,11 +826,11 @@ public:
}
void grow(unsigned AtLeast) {
- if (AtLeast > InlineBuckets)
+ if (AtLeast >= InlineBuckets)
AtLeast = std::max<unsigned>(64, NextPowerOf2(AtLeast));
if (Small) {
- if (AtLeast <= InlineBuckets)
+ if (AtLeast < InlineBuckets)
return; // Nothing to do.
// First move the inline buckets into a temporary storage.