From 26a3661a10653ee186482d23b4efc94ed1eaf6c8 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 12 Oct 2012 22:56:42 +0000 Subject: 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. llvm-svn: 165841 --- clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang') diff --git a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index b8b7c367969..5cd61941841 100644 --- a/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/clang/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; -- cgit v1.2.3