diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-24 01:59:46 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-24 01:59:46 +0000 |
commit | 6281213d87e71b76f64c4ca62fbe7a97f18ae0a0 (patch) | |
tree | ff531d3906a65d865d43274f16f1ea54a433694f | |
parent | 919f0665c35f76636d600f0e351920f6a37ee6cf (diff) |
Fix bug I just introduced in ForStmt::child_end() where we could iterate off into garbage values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92115 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Stmt.h | 4 | ||||
-rw-r--r-- | lib/AST/Stmt.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 406684c8aa..33edadc3a5 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -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; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index ad1db9004f..7c7aeb8d3e 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -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 |