Skip to content

Commit 3cd3f11

Browse files
committed
[NFC][AMDGPU] Default initialize the Subtarget
This is to address a static analizer warning: The pointer field will point to an arbitrary memory location, any attempt to write may cause corruption. In <unnamed> R600DAGToDAGISel.:R600DAGToDAGISel (llvm::TargetMachine &, livm::CodeGenOpt::Level): A pointer field is not initialized in the constructor (CWE-457) Differential Revision: https://reviews.llvm.org/D154414
1 parent faca9fd commit 3cd3f11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace {
2222
class R600DAGToDAGISel : public AMDGPUDAGToDAGISel {
23-
const R600Subtarget *Subtarget;
23+
const R600Subtarget *Subtarget = nullptr;
2424

2525
bool isConstantLoad(const MemSDNode *N, int cbID) const;
2626
bool SelectGlobalValueConstantOffset(SDValue Addr, SDValue &IntPtr);

0 commit comments

Comments
 (0)