]> granicus.if.org Git - clang/commitdiff
Another ParentMap bug: only the right side of a comma expression is consumed.
authorTed Kremenek <kremenek@apple.com>
Thu, 9 Apr 2009 05:34:31 +0000 (05:34 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 9 Apr 2009 05:34:31 +0000 (05:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68680 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ParentMap.cpp

index 33731c63ed8902ce3c9a21319ebd41d8d499acce..a27b0fd270cbcc99102780d8f7336fb77a105282 100644 (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();