diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-10-12 22:56:42 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-10-12 22:56:42 +0000 |
commit | 26a3661a10653ee186482d23b4efc94ed1eaf6c8 (patch) | |
tree | 6d94a1873320bf8bcbf8cd45862507af01f42813 /clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp | |
parent | b045b01840455aad8781c6ec82b073c432e3fc06 (diff) | |
download | bcm5719-llvm-26a3661a10653ee186482d23b4efc94ed1eaf6c8.tar.gz bcm5719-llvm-26a3661a10653ee186482d23b4efc94ed1eaf6c8.zip |
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
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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<SourceRange, 2> ranges; |