Skip to content

Commit 879c12d

Browse files
committed
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.
1 parent f82cff3 commit 879c12d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ bool StdLibraryFunctionsChecker::evalCall(const CallEvent &Call,
742742
case EvalCallAsPure: {
743743
ProgramStateRef State = C.getState();
744744
const LocationContext *LC = C.getLocationContext();
745-
const auto *CE = cast_or_null<CallExpr>(Call.getOriginExpr());
745+
const auto *CE = cast<CallExpr>(Call.getOriginExpr());
746746
SVal V = C.getSValBuilder().conjureSymbolVal(
747747
CE, LC, CE->getType().getCanonicalType(), C.blockCount());
748748
State = State->BindExpr(CE, LC, V);

0 commit comments

Comments
 (0)