forked from OSchip/llvm-project
1756d67934
All these potential null pointer dereferences are reported by my static analyzer for null smart pointer dereferences, which has a different implementation from `alpha.cplusplus.SmartPtr`. The checked pointers in this patch are initialized by Target::createXXX functions. When the creator function pointer is not correctly set, a null pointer will be returned, or the creator function may originally return a null pointer. Some of them may not make sense as they may be checked before entering the function, but I fixed them all in this patch. I submit this fix because 1) similar checks are found in some other places in the LLVM codebase for the same return value of the function; and, 2) some of the pointers are dereferenced before they are checked, which may definitely trigger a null pointer dereference if the return value is nullptr. Reviewed By: tejohnson, MaskRay, jpienaar Differential Revision: https://reviews.llvm.org/D91410 |
||
---|---|---|
.. | ||
AArch64 | ||
Mips | ||
PowerPC | ||
X86 | ||
Analysis.cpp | ||
Analysis.h | ||
Assembler.cpp | ||
Assembler.h | ||
BenchmarkCode.h | ||
BenchmarkResult.cpp | ||
BenchmarkResult.h | ||
BenchmarkRunner.cpp | ||
BenchmarkRunner.h | ||
CMakeLists.txt | ||
Clustering.cpp | ||
Clustering.h | ||
CodeTemplate.cpp | ||
CodeTemplate.h | ||
Error.cpp | ||
Error.h | ||
LatencyBenchmarkRunner.cpp | ||
LatencyBenchmarkRunner.h | ||
LlvmState.cpp | ||
LlvmState.h | ||
MCInstrDescView.cpp | ||
MCInstrDescView.h | ||
ParallelSnippetGenerator.cpp | ||
ParallelSnippetGenerator.h | ||
PerfHelper.cpp | ||
PerfHelper.h | ||
RegisterAliasing.cpp | ||
RegisterAliasing.h | ||
RegisterValue.cpp | ||
RegisterValue.h | ||
SchedClassResolution.cpp | ||
SchedClassResolution.h | ||
SerialSnippetGenerator.cpp | ||
SerialSnippetGenerator.h | ||
SnippetFile.cpp | ||
SnippetFile.h | ||
SnippetGenerator.cpp | ||
SnippetGenerator.h | ||
SnippetRepetitor.cpp | ||
SnippetRepetitor.h | ||
Target.cpp | ||
Target.h | ||
TargetSelect.h | ||
UopsBenchmarkRunner.cpp | ||
UopsBenchmarkRunner.h |