[ValueLattice] Fix uninitialized-value after D79036

Many check-clang-codegen tests failed.
This commit is contained in:
Fangrui Song 2020-05-29 19:48:33 -07:00
parent d04147789f
commit 034a7b6604
1 changed files with 5 additions and 3 deletions

View File

@ -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: