diff options
| author | Ted Kremenek <kremenek@apple.com> | 2013-05-08 01:15:20 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2013-05-08 01:15:20 +0000 |
| commit | 0e84ac83eba17c6f2e7f675be4d0bab020841680 (patch) | |
| tree | 61380c3da72fed084264fa40bd394205f4ee2bc2 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
| parent | c57baeeee079c7065911b53ed445a292e502bb3f (diff) | |
| download | bcm5719-llvm-0e84ac83eba17c6f2e7f675be4d0bab020841680.tar.gz bcm5719-llvm-0e84ac83eba17c6f2e7f675be4d0bab020841680.zip | |
[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
llvm-svn: 181384
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index ad41e5fe38a..ccfc5f73860 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1833,8 +1833,12 @@ static bool isConditionForTerminator(const Stmt *S, const Stmt *Cond) { return cast<SwitchStmt>(S)->getCond() == Cond; case Stmt::BinaryConditionalOperatorClass: return cast<BinaryConditionalOperator>(S)->getCond() == Cond; - case Stmt::ConditionalOperatorClass: - return cast<ConditionalOperator>(S)->getCond() == Cond; + case Stmt::ConditionalOperatorClass: { + const ConditionalOperator *CO = cast<ConditionalOperator>(S); + return CO->getCond() == Cond || + CO->getLHS() == Cond || + CO->getRHS() == Cond; + } case Stmt::ObjCForCollectionStmtClass: return cast<ObjCForCollectionStmt>(S)->getElement() == Cond; default: |

