Fix APInt value initialization to give a zero value as any sane integer type
[oota-llvm.git] / include / llvm / ADT / APInt.h
index ea67e7928a7e0124b76314e2c748cb3270ebb6d3..e2a0cb5e69dc0d67f9eac4c17bfc7858eef8eab7 100644 (file)
@@ -294,11 +294,12 @@ public:
       delete[] pVal;
   }
 
-  /// \brief Default constructor that creates an uninitialized APInt.
+  /// \brief Default constructor that creates an uninteresting APInt
+  /// representing a 1-bit zero value.
   ///
   /// This is useful for object deserialization (pair this with the static
   ///  method Read).
-  explicit APInt() : BitWidth(1) {}
+  explicit APInt() : BitWidth(1), VAL(0) {}
 
   /// \brief Returns whether this instance allocated memory.
   bool needsCleanup() const { return !isSingleWord(); }