Avoid crash when child iterator gives null result.

llvm-svn: 65812
This commit is contained in:
Daniel Dunbar 2009-03-02 07:00:57 +00:00
parent 51adf5824e
commit dd9427133a
1 changed files with 2 additions and 1 deletions

View File

@ -111,7 +111,8 @@ static void CollectBlockDeclRefInfo(const Stmt *S,
CodeGenFunction::BlockInfo &Info) {
for (Stmt::const_child_iterator I = S->child_begin(), E = S->child_end();
I != E; ++I)
CollectBlockDeclRefInfo(*I, Info);
if (*I)
CollectBlockDeclRefInfo(*I, Info);
if (const BlockDeclRefExpr *DE = dyn_cast<BlockDeclRefExpr>(S)) {
// FIXME: Handle enums.