From cf033bb2d39c42818e3f13829b5ac6cc66b0ed6f Mon Sep 17 00:00:00 2001 From: Jeremy Morse Date: Tue, 19 Oct 2021 10:24:12 +0100 Subject: [PATCH] [DebugInfo][NFC] Zero-initialize a class field 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h index cc0a1d7..4e59db0 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h @@ -574,7 +574,7 @@ public: /// much later stage, in the TransferTracker class. MapVector Vars; DenseMap Scopes; - MachineBasicBlock *MBB; + MachineBasicBlock *MBB = nullptr; public: VLocTracker() {} -- 2.7.4