[cfe-commits] r62306 - /cfe/trunk/lib/AST/Stmt.cpp
Douglas Gregor
dgregor at apple.com
Thu Jan 15 22:50:08 PST 2009
Author: dgregor
Date: Fri Jan 16 00:50:08 2009
New Revision: 62306
URL: http://llvm.org/viewvc/llvm-project?rev=62306&view=rev
Log:
Don't advance the statement iterator after we've deallocated the statement
Modified:
cfe/trunk/lib/AST/Stmt.cpp
Modified: cfe/trunk/lib/AST/Stmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=62306&r1=62305&r2=62306&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Stmt.cpp (original)
+++ cfe/trunk/lib/AST/Stmt.cpp Fri Jan 16 00:50:08 2009
@@ -43,8 +43,9 @@
}
void Stmt::DestroyChildren(ASTContext& C) {
- for (child_iterator I = child_begin(), E = child_end(); I !=E; ++I)
- if (Stmt* Child = *I) Child->Destroy(C);
+ for (child_iterator I = child_begin(), E = child_end(); I !=E; ) {
+ if (Stmt* Child = *I++) Child->Destroy(C);
+ }
}
void Stmt::Destroy(ASTContext& C) {
More information about the cfe-commits
mailing list