[APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being constructed.
[oota-llvm.git] / include / llvm / ADT / APInt.h
index 8bfdcbfa364204e230a21c0e5034099a2c807b83..8f5c72d8a2e68b2290187b8a210424159b7c4caf 100644 (file)
@@ -1265,7 +1265,7 @@ public:
   /// \returns the number of words to hold the integer value with a given bit
   /// width.
   static unsigned getNumWords(unsigned BitWidth) {
-    return (BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
+    return ((uint64_t)BitWidth + APINT_BITS_PER_WORD - 1) / APINT_BITS_PER_WORD;
   }
 
   /// \brief Compute the number of active bits in the value