diff --git a/clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp --- a/clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp @@ -653,10 +653,11 @@ if (Type.isSuppressOnSink()) { const ExplodedNode *AcquireNode = getAcquireSite(ErrorNode, Sym, C); if (AcquireNode) { + const Stmt *S = AcquireNode->getStmtForDiagnostics(); + assert(S && "Statement cannot be null."); PathDiagnosticLocation LocUsedForUniqueing = PathDiagnosticLocation::createBegin( - AcquireNode->getStmtForDiagnostics(), C.getSourceManager(), - AcquireNode->getLocationContext()); + S, C.getSourceManager(), AcquireNode->getLocationContext()); R = std::make_unique( Type, Msg, ErrorNode, LocUsedForUniqueing,