From 8484b37a2b7720c016d27a672343b1c67bd2e731 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 8 May 2013 01:15:20 +0000 Subject: [PATCH] [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 --- lib/StaticAnalyzer/Core/BugReporter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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: -- 2.40.0