aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-01-26 16:19:18 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-01-26 16:19:18 +0000
commit879c12d95a27a62797aede2f7d4f1886ad439d5d (patch)
tree4854336934fa77a378d81131085d7d55405034a3 /clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
parentf82cff31d35d77510e00dab5c772db8b013497ee (diff)
downloadllvm-879c12d95a27a62797aede2f7d4f1886ad439d5d.zip
llvm-879c12d95a27a62797aede2f7d4f1886ad439d5d.tar.gz
llvm-879c12d95a27a62797aede2f7d4f1886ad439d5d.tar.bz2
Fix null dereference static analysis warning. NFCI.
Replace cast_or_null<> with cast<> as we immediately dereference the pointer afterward so we're not expecting a null pointer.
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
index f0710a6..d1c366a 100644
--- a/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
@@ -742,7 +742,7 @@ bool StdLibraryFunctionsChecker::evalCall(const CallEvent &Call,
case EvalCallAsPure: {
ProgramStateRef State = C.getState();
const LocationContext *LC = C.getLocationContext();
- const auto *CE = cast_or_null<CallExpr>(Call.getOriginExpr());
+ const auto *CE = cast<CallExpr>(Call.getOriginExpr());
SVal V = C.getSValBuilder().conjureSymbolVal(
CE, LC, CE->getType().getCanonicalType(), C.blockCount());
State = State->BindExpr(CE, LC, V);