From e8ce626308eb047d226847660e7dceed1169038f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 20 Dec 2012 03:59:24 +0000 Subject: [PATCH] Don't leave IsUnsigned uninitialized in a default-constructed APSInt. Copying such a structure has undefined behavior. Caught by -fsanitize=bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170652 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APSInt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h index 048c65ce2c7..4a5e7a3918e 100644 --- a/include/llvm/ADT/APSInt.h +++ b/include/llvm/ADT/APSInt.h @@ -23,7 +23,7 @@ class APSInt : public APInt { bool IsUnsigned; public: /// Default constructor that creates an uninitialized APInt. - explicit APSInt() {} + explicit APSInt() : IsUnsigned(false) {} /// APSInt ctor - Create an APSInt with the specified width, default to /// unsigned.