From: Jeremy Morse Date: Tue, 19 Oct 2021 09:24:12 +0000 (+0100) Subject: [DebugInfo][NFC] Zero-initialize a class field X-Git-Tag: upstream/15.0.7~28256 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf033bb2d39c42818e3f13829b5ac6cc66b0ed6f;p=platform%2Fupstream%2Fllvm.git [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. --- 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() {}