mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +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:
		| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user