]> granicus.if.org Git - clang/commitdiff
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into...
authorTed Kremenek <kremenek@apple.com>
Thu, 24 Dec 2009 01:59:46 +0000 (01:59 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 24 Dec 2009 01:59:46 +0000 (01:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92115 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Stmt.h
lib/AST/Stmt.cpp

index 406684c8aa5b4af9924d4bf614a5e98d072edb09..33edadc3a5e64356d124b5f5a255257dec56b7ce 100644 (file)
@@ -879,9 +879,9 @@ class ForStmt : public Stmt {
   SourceLocation LParenLoc, RParenLoc;
 
 public:
-  ForStmt(Stmt *Init, Expr *Cond, VarDecl *CondVar, Expr *Inc, Stmt *Body, 
+  ForStmt(Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, Stmt *Body, 
           SourceLocation FL, SourceLocation LP, SourceLocation RP)
-    : Stmt(ForStmtClass), CondVar(CondVar), ForLoc(FL), LParenLoc(LP), 
+    : Stmt(ForStmtClass), CondVar(condVar), ForLoc(FL), LParenLoc(LP), 
       RParenLoc(RP) 
   {
     SubExprs[INIT] = Init;
index ad1db9004f65af511a3a669f40e04005be85e6f8..7c7aeb8d3e1df2fddc4bf430d3a61515bfb0a90b 100644 (file)
@@ -519,7 +519,7 @@ Stmt::child_iterator ForStmt::child_begin() {
   return child_iterator(CondVar, &SubExprs[0]);
 }
 Stmt::child_iterator ForStmt::child_end() {
-  return child_iterator(CondVar, &SubExprs[0]+END_EXPR);
+  return child_iterator(0, &SubExprs[0]+END_EXPR);
 }
 
 // ObjCForCollectionStmt