[DebugInfo][NFC] Zero-initialize a class field
authorJeremy Morse <jeremy.morse@sony.com>
Tue, 19 Oct 2021 09:24:12 +0000 (10:24 +0100)
committerJeremy Morse <jeremy.morse@sony.com>
Tue, 19 Oct 2021 09:24:12 +0000 (10:24 +0100)
This field gets assigned when the relevant object starts being used; but it
remains uninitialized beforehand. This risks introducing hard-to-detect
bugs if something changes, so zero-initialize the field.

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h

index cc0a1d7..4e59db0 100644 (file)
@@ -574,7 +574,7 @@ public:
   /// much later stage, in the TransferTracker class.
   MapVector<DebugVariable, DbgValue> Vars;
   DenseMap<DebugVariable, const DILocation *> Scopes;
-  MachineBasicBlock *MBB;
+  MachineBasicBlock *MBB = nullptr;
 
 public:
   VLocTracker() {}