]> granicus.if.org Git - clang/commitdiff
[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain
authorTed Kremenek <kremenek@apple.com>
Wed, 8 May 2013 01:15:20 +0000 (01:15 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 8 May 2013 01:15:20 +0000 (01:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181384 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index ad41e5fe38a87e279653a5dfa2250365380efeb2..ccfc5f7386023e7a6413189b9d4ed24447fe1736 100644 (file)
@@ -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: