[Mlir-commits] [mlir] 7182d2d - [mlir][AffineStructures] Explicitly initialize variables to avoid use of uninitialized variable

River Riddle llvmlistbot at llvm.org
Thu Apr 30 12:12:57 PDT 2020


Author: River Riddle
Date: 2020-04-30T12:12:42-07:00
New Revision: 7182d2da056fad639378aae58536a8235ffa87aa

URL: https://github.com/llvm/llvm-project/commit/7182d2da056fad639378aae58536a8235ffa87aa
DIFF: https://github.com/llvm/llvm-project/commit/7182d2da056fad639378aae58536a8235ffa87aa.diff

LOG: [mlir][AffineStructures] Explicitly initialize variables to avoid use of uninitialized variable

Added: 
    

Modified: 
    mlir/lib/Analysis/AffineStructures.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp
index 17e380d60b05..b43cd6bd7be6 100644
--- a/mlir/lib/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Analysis/AffineStructures.cpp
@@ -2075,7 +2075,7 @@ Optional<int64_t> FlatAffineConstraints::getConstantBoundOnDimSize(
                                /*num=*/getNumDimIds());
 
   Optional<int64_t> minDiff = None;
-  unsigned minLbPosition, minUbPosition;
+  unsigned minLbPosition = 0, minUbPosition = 0;
   for (auto ubPos : ubIndices) {
     for (auto lbPos : lbIndices) {
       // Look for a lower bound and an upper bound that only 
diff er by a


        


More information about the Mlir-commits mailing list