[analyzer; alternate arrows] include logical '||' and '&&' as anchors for edges.

llvm-svn: 181359
This commit is contained in:
Ted Kremenek 2013-05-07 21:11:57 +00:00
parent 3a865221c7
commit b48f5d9d56
1 changed files with 6 additions and 1 deletions

View File

@ -1815,8 +1815,13 @@ const Stmt *getStmtParent(const Stmt *S, ParentMap &PM) {
}
static bool isConditionForTerminator(const Stmt *S, const Stmt *Cond) {
// Note that we intentionally to do not handle || and && here.
switch (S->getStmtClass()) {
case Stmt::BinaryOperatorClass: {
const BinaryOperator *BO = cast<BinaryOperator>(S);
if (!BO->isLogicalOp())
return false;
return BO->getLHS() == Cond || BO->getRHS() == Cond;
}
case Stmt::IfStmtClass:
return cast<IfStmt>(S)->getCond() == Cond;
case Stmt::ForStmtClass: