summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/APSInt.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-20 03:59:24 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-20 03:59:24 +0000
commite8ce626308eb047d226847660e7dceed1169038f (patch)
tree53ae7b34f6c5bd215f8a1c6661e1eab4154e9d7d /include/llvm/ADT/APSInt.h
parent2427773f2f18a2dd630428d7df927a5cdf4280f1 (diff)
downloadllvm-e8ce626308eb047d226847660e7dceed1169038f.tar.gz
llvm-e8ce626308eb047d226847660e7dceed1169038f.tar.bz2
llvm-e8ce626308eb047d226847660e7dceed1169038f.tar.xz
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
Diffstat (limited to 'include/llvm/ADT/APSInt.h')
-rw-r--r--include/llvm/ADT/APSInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h
index 048c65ce2c..4a5e7a3918 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.