From: Fangrui Song Date: Sat, 30 May 2020 02:48:33 +0000 (-0700) Subject: [ValueLattice] Fix uninitialized-value after D79036 X-Git-Tag: llvmorg-12-init~4621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=034a7b6604067b0ccb36c761a5782456b76c447e;p=platform%2Fupstream%2Fllvm.git [ValueLattice] Fix uninitialized-value after D79036 Many check-clang-codegen tests failed. --- diff --git a/llvm/include/llvm/Analysis/ValueLattice.h b/llvm/include/llvm/Analysis/ValueLattice.h index 00a230f..bf5bab9 100644 --- a/llvm/include/llvm/Analysis/ValueLattice.h +++ b/llvm/include/llvm/Analysis/ValueLattice.h @@ -142,11 +142,12 @@ public: }; // ConstVal and Range are initialized on-demand. - ValueLatticeElement() : Tag(unknown) {} + ValueLatticeElement() : Tag(unknown), NumRangeExtensions(0) {} ~ValueLatticeElement() { destroy(); } - ValueLatticeElement(const ValueLatticeElement &Other) : Tag(Other.Tag) { + ValueLatticeElement(const ValueLatticeElement &Other) + : Tag(Other.Tag), NumRangeExtensions(0) { switch (Other.Tag) { case constantrange: case constantrange_including_undef: @@ -164,7 +165,8 @@ public: } } - ValueLatticeElement(ValueLatticeElement &&Other) : Tag(Other.Tag) { + ValueLatticeElement(ValueLatticeElement &&Other) + : Tag(Other.Tag), NumRangeExtensions(0) { switch (Other.Tag) { case constantrange: case constantrange_including_undef: