[cfe-commits] r165841 - /cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

Ted Kremenek kremenek at apple.com
Fri Oct 12 15:56:42 PDT 2012


Author: kremenek
Date: Fri Oct 12 17:56:42 2012
New Revision: 165841

URL: http://llvm.org/viewvc/llvm-project?rev=165841&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp?rev=165841&r1=165840&r2=165841&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp Fri Oct 12 17:56:42 2012
@@ -270,6 +270,7 @@
 
   // 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;





More information about the cfe-commits mailing list