[llvm] r301033 - Fixed a type conversion error in BitVector.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 13:18:43 PDT 2017


Author: zturner
Date: Fri Apr 21 15:18:43 2017
New Revision: 301033

URL: http://llvm.org/viewvc/llvm-project?rev=301033&view=rev
Log:
Fixed a type conversion error in BitVector.

Modified:
    llvm/trunk/include/llvm/ADT/BitVector.h

Modified: llvm/trunk/include/llvm/ADT/BitVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/BitVector.h?rev=301033&r1=301032&r2=301033&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/BitVector.h (original)
+++ llvm/trunk/include/llvm/ADT/BitVector.h Fri Apr 21 15:18:43 2017
@@ -755,7 +755,7 @@ private:
   }
 
   void grow(unsigned NewSize) {
-    unsigned NewCapacity = std::max(NumBitWords(NewSize), Bits.size() * 2);
+    size_t NewCapacity = std::max<size_t>(NumBitWords(NewSize), Bits.size() * 2);
     assert(NewCapacity > 0 && "realloc-ing zero space");
     BitWord *NewBits =
         (BitWord *)std::realloc(Bits.data(), NewCapacity * sizeof(BitWord));




More information about the llvm-commits mailing list