diff options
author | Pete Cooper <peter_cooper@apple.com> | 2012-10-23 18:47:35 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2012-10-23 18:47:35 +0000 |
commit | fbaf206f470b5a6a54811547641ee41368a2cccd (patch) | |
tree | 66121671838185f2576d1cec6b83587cfbeecb91 /include | |
parent | 6457001f31713ff26a707ddef616341052b1b296 (diff) | |
download | external_llvm-fbaf206f470b5a6a54811547641ee41368a2cccd.zip external_llvm-fbaf206f470b5a6a54811547641ee41368a2cccd.tar.gz external_llvm-fbaf206f470b5a6a54811547641ee41368a2cccd.tar.bz2 |
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.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index cbcf789..0ae54f4 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. |