diff options
| author | Ted Kremenek <kremenek@apple.com> | 2013-05-07 21:11:57 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2013-05-07 21:11:57 +0000 |
| commit | b48f5d9d561e7eaeded6f83f0cc153d38c6dcb62 (patch) | |
| tree | b24852f9b6dcb82e515080cc3da4f1a5b4d8b755 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
| parent | 3a865221c7b4d5d380399df08ae061081420bc50 (diff) | |
| download | bcm5719-llvm-b48f5d9d561e7eaeded6f83f0cc153d38c6dcb62.tar.gz bcm5719-llvm-b48f5d9d561e7eaeded6f83f0cc153d38c6dcb62.zip | |
[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
llvm-svn: 181359
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index a74acca0605..f4aa9ef6f48 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1815,8 +1815,13 @@ const Stmt *getStmtParent(const Stmt *S, ParentMap &PM) { } static bool isConditionForTerminator(const Stmt *S, const Stmt *Cond) { - // Note that we intentionally to do not handle || and && here. switch (S->getStmtClass()) { + case Stmt::BinaryOperatorClass: { + const BinaryOperator *BO = cast<BinaryOperator>(S); + if (!BO->isLogicalOp()) + return false; + return BO->getLHS() == Cond || BO->getRHS() == Cond; + } case Stmt::IfStmtClass: return cast<IfStmt>(S)->getCond() == Cond; case Stmt::ForStmtClass: |

