mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Avoid undefined behavior in DenseMap::shrink_and_clear(). Log2_32_Ceil(0)
returns 32. This change mirrors the corresponding code in SmallDenseMap::shrink_and_clear(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a61d3a98c4
commit
b8ea08ca8c
@ -617,8 +617,9 @@ public:
|
||||
this->destroyAll();
|
||||
|
||||
// Reduce the number of buckets.
|
||||
unsigned NewNumBuckets
|
||||
= std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1));
|
||||
unsigned NewNumBuckets = 0;
|
||||
if (OldNumEntries)
|
||||
NewNumBuckets = std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1));
|
||||
if (NewNumBuckets == NumBuckets) {
|
||||
this->BaseT::initEmpty();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user