Avoid crash when child iterator gives null result.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65812 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index e50b320..ee17a86 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -111,7 +111,8 @@
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.