From: Ted Kremenek Date: Fri, 12 Oct 2012 22:56:42 +0000 (+0000) Subject: Silence static analyzer issue by documenting that in this context X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0f3d7148ca761fda2243528b2b62f916770f546;p=clang Silence static analyzer issue by documenting that in this context that a DeclRefExpr can never return a null decl. We possibly should hoist this into getDecl() itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165841 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index b8b7c36796..5cd6194184 100644 --- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -270,6 +270,7 @@ void WalkAST::checkLoopConditionForFloat(const ForStmt *FS) { // Emit the error. First figure out which DeclRefExpr in the condition // referenced the compared variable. + assert(drInc->getDecl()); const DeclRefExpr *drCond = vdLHS == drInc->getDecl() ? drLHS : drRHS; SmallVector ranges;