]> granicus.if.org Git - clang/commitdiff
Silence static analyzer issue by documenting that in this context
authorTed Kremenek <kremenek@apple.com>
Fri, 12 Oct 2012 22:56:42 +0000 (22:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 12 Oct 2012 22:56:42 +0000 (22:56 +0000)
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

lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

index b8b7c367969c5c423457c12c918187b6fb04838c..5cd61941841d832d8df53cd190a2d9cc981c4583 100644 (file)
@@ -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<SourceRange, 2> ranges;