From: Ted Kremenek Date: Wed, 8 May 2013 01:15:20 +0000 (+0000) Subject: [analyzer;alternate edges] edges from subexpressions of "?:" are important to retain X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8484b37a2b7720c016d27a672343b1c67bd2e731;p=clang [analyzer;alternate edges] edges from subexpressions of "?:" are important to retain git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181384 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index ad41e5fe38..ccfc5f7386 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -1833,8 +1833,12 @@ static bool isConditionForTerminator(const Stmt *S, const Stmt *Cond) { return cast(S)->getCond() == Cond; case Stmt::BinaryConditionalOperatorClass: return cast(S)->getCond() == Cond; - case Stmt::ConditionalOperatorClass: - return cast(S)->getCond() == Cond; + case Stmt::ConditionalOperatorClass: { + const ConditionalOperator *CO = cast(S); + return CO->getCond() == Cond || + CO->getLHS() == Cond || + CO->getRHS() == Cond; + } case Stmt::ObjCForCollectionStmtClass: return cast(S)->getElement() == Cond; default: