[llvm] 3cd3f11 - [NFC][AMDGPU] Default initialize the Subtarget
Jakub Chlanda via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 02:39:38 PDT 2023
Author: Jakub Chlanda
Date: 2023-07-17T11:39:29+02:00
New Revision: 3cd3f11c174baa001b337b88c7a6507eb5705cf2
URL: https://github.com/llvm/llvm-project/commit/3cd3f11c174baa001b337b88c7a6507eb5705cf2
DIFF: https://github.com/llvm/llvm-project/commit/3cd3f11c174baa001b337b88c7a6507eb5705cf2.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp b/llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp
index 50a90dd03f3833..20c2ff8a4fd728 100644
--- a/llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/AMDGPU/R600ISelDAGToDAG.cpp
@@ -20,7 +20,7 @@
namespace {
class R600DAGToDAGISel : public AMDGPUDAGToDAGISel {
- const R600Subtarget *Subtarget;
+ const R600Subtarget *Subtarget = nullptr;
bool isConstantLoad(const MemSDNode *N, int cbID) const;
bool SelectGlobalValueConstantOffset(SDValue Addr, SDValue &IntPtr);
More information about the llvm-commits
mailing list