aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-10-12 22:56:42 +0000
committerTed Kremenek <kremenek@apple.com>2012-10-12 22:56:42 +0000
commitd0f3d7148ca761fda2243528b2b62f916770f546 (patch)
tree8179c9821bc02744920a1e9efb424f31081442cc /lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
parent5a8fc88b18793f25d4423805d7e4ac5d0325b9a6 (diff)
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
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp1
1 files changed, 1 insertions, 0 deletions
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<SourceRange, 2> ranges;