r181384 - [analyzer; alternate edges] edges from subexpressions of "?:" are important to retain

Ted Kremenek kremenek at apple.com
Tue May 7 18:15:20 PDT 2013


Author: kremenek
Date: Tue May  7 20:15:20 2013
New Revision: 181384

URL: http://llvm.org/viewvc/llvm-project?rev=181384&view=rev
Log:
[analyzer;alternate edges] edges from subexpressions of "?:" are important to retain

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=181384&r1=181383&r2=181384&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Tue May  7 20:15:20 2013
@@ -1833,8 +1833,12 @@ static bool isConditionForTerminator(con
       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:





More information about the cfe-commits mailing list