Another ParentMap bug: only the right side of a comma expression is consumed.

llvm-svn: 68680
This commit is contained in:
Ted Kremenek 2009-04-09 05:34:31 +00:00
parent c3f7c85129
commit 042befd6d6
1 changed files with 2 additions and 2 deletions

View File

@ -66,9 +66,9 @@ bool ParentMap::isConsumedExpr(Expr* E) const {
return true;
case Stmt::BinaryOperatorClass: {
BinaryOperator *BE = cast<BinaryOperator>(P);
// If it is a comma, only the left side is consumed.
// If it is a comma, only the right side is consumed.
// If it isn't a comma, both sides are consumed.
return BE->getOpcode()!=BinaryOperator::Comma || DirectChild==BE->getLHS();
return BE->getOpcode()!=BinaryOperator::Comma ||DirectChild==BE->getRHS();
}
case Stmt::ForStmtClass:
return DirectChild == cast<ForStmt>(P)->getCond();