[llvm] 034a7b6 - [ValueLattice] Fix uninitialized-value after D79036

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 19:52:45 PDT 2020


Author: Fangrui Song
Date: 2020-05-29T19:52:29-07:00
New Revision: 034a7b6604067b0ccb36c761a5782456b76c447e

URL: https://github.com/llvm/llvm-project/commit/034a7b6604067b0ccb36c761a5782456b76c447e
DIFF: https://github.com/llvm/llvm-project/commit/034a7b6604067b0ccb36c761a5782456b76c447e.diff

LOG: [ValueLattice] Fix uninitialized-value after D79036

Many check-clang-codegen tests failed.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/ValueLattice.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/ValueLattice.h b/llvm/include/llvm/Analysis/ValueLattice.h
index 00a230fb08c5..bf5bab9ced22 100644
--- a/llvm/include/llvm/Analysis/ValueLattice.h
+++ b/llvm/include/llvm/Analysis/ValueLattice.h
@@ -142,11 +142,12 @@ class ValueLatticeElement {
   };
 
   // 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 @@ class ValueLatticeElement {
     }
   }
 
-  ValueLatticeElement(ValueLatticeElement &&Other) : Tag(Other.Tag) {
+  ValueLatticeElement(ValueLatticeElement &&Other)
+      : Tag(Other.Tag), NumRangeExtensions(0) {
     switch (Other.Tag) {
     case constantrange:
     case constantrange_including_undef:


        


More information about the llvm-commits mailing list