[llvm] e06dac0 - [LiveDebugValues] Initialized variable to avoid msan reports

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 00:26:56 PDT 2023


Author: Vitaly Buka
Date: 2023-05-18T00:26:40-07:00
New Revision: e06dac07a12c997464de11cf6783a7f3269bc8b4

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

LOG: [LiveDebugValues] Initialized variable to avoid msan reports

Reproducible with =-1 and assert: https://reviews.llvm.org/P8309

Reviewed By: jmorse

Differential Revision: https://reviews.llvm.org/D150420

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
index beac17f79ff40..30de18e53c4fb 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
@@ -656,7 +656,7 @@ class MLocTracker {
 
   // If we discover a new machine location, assign it an mphi with this
   // block number.
-  unsigned CurBB = 0; // FIXME: https://reviews.llvm.org/D150420
+  unsigned CurBB = -1;
 
   /// Cached local copy of the number of registers the target has.
   unsigned NumRegs;
@@ -1094,7 +1094,7 @@ class InstrRefBasedLDV : public LDVImpl {
   MLocTracker *MTracker = nullptr;
 
   /// Number of the current block LiveDebugValues is stepping through.
-  unsigned CurBB;
+  unsigned CurBB = -1;
 
   /// Number of the current instruction LiveDebugValues is evaluating.
   unsigned CurInst;


        


More information about the llvm-commits mailing list