[cfe-commits] r68680 - /cfe/trunk/lib/AST/ParentMap.cpp

Ted Kremenek kremenek at apple.com
Wed Apr 8 22:34:31 PDT 2009


Author: kremenek
Date: Thu Apr  9 00:34:31 2009
New Revision: 68680

URL: http://llvm.org/viewvc/llvm-project?rev=68680&view=rev
Log:
Another ParentMap bug: only the right side of a comma expression is consumed.

Modified:
    cfe/trunk/lib/AST/ParentMap.cpp

Modified: cfe/trunk/lib/AST/ParentMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ParentMap.cpp?rev=68680&r1=68679&r2=68680&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ParentMap.cpp (original)
+++ cfe/trunk/lib/AST/ParentMap.cpp Thu Apr  9 00:34:31 2009
@@ -66,9 +66,9 @@
       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();





More information about the cfe-commits mailing list