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 | 03194fb1bbf2b2d17ff7e3d61ddb9d73e9297fdc (patch) | |
| tree | a8fd3ef700befb7fb76b02074d6da5f7e6a4941e /lib/StaticAnalyzer/Core/BugReporter.cpp | |
| parent | bc0fd8129626ff4e485388311b081e76d0f96795 (diff) | |
| download | clang-03194fb1bbf2b2d17ff7e3d61ddb9d73e9297fdc.tar.gz clang-03194fb1bbf2b2d17ff7e3d61ddb9d73e9297fdc.tar.bz2 clang-03194fb1bbf2b2d17ff7e3d61ddb9d73e9297fdc.tar.xz | |
[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/BugReporter.cpp')
| -rw-r--r-- | lib/StaticAnalyzer/Core/BugReporter.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index a74acca060..f4aa9ef6f4 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/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: |
