diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-03-13 20:03:31 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-03-13 20:03:31 +0000 |
commit | 2fb5f09e155c52c80d66ff90d12329bbf0403c72 (patch) | |
tree | f63f2c486714326ef8c3b2e424a2e121f61f0d69 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | cebc623798aa304ba3b266b8f7b21d2106dec7d2 (diff) | |
download | bcm5719-llvm-2fb5f09e155c52c80d66ff90d12329bbf0403c72.tar.gz bcm5719-llvm-2fb5f09e155c52c80d66ff90d12329bbf0403c72.zip |
[analyzer] Handle Objc Fast enumeration for "loop is executed 0 times".
Fixes <rdar://problem/12322528>
llvm-svn: 176965
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 0729b5e8428..566a58032c0 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1305,6 +1305,7 @@ static bool isLoopJumpPastBody(const Stmt *Term, const BlockEdge *BE) { switch (Term->getStmtClass()) { case Stmt::ForStmtClass: case Stmt::WhileStmtClass: + case Stmt::ObjCForCollectionStmtClass: break; default: // Note that we intentionally do not include do..while here. @@ -1350,6 +1351,12 @@ static bool isInLoopBody(ParentMap &PM, const Stmt *S, const Stmt *Term) { LoopBody = FS->getBody(); break; } + case Stmt::ObjCForCollectionStmtClass: { + const ObjCForCollectionStmt *FC = cast<ObjCForCollectionStmt>(Term); + LoopBody = FC->getBody(); + break; + + } case Stmt::WhileStmtClass: LoopBody = cast<WhileStmt>(Term)->getBody(); break; |