From: Daniel Dunbar Date: Mon, 2 Mar 2009 07:00:57 +0000 (+0000) Subject: Avoid crash when child iterator gives null result. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82573ee7419091e5ec87e2f4fa254c7a285781d6;p=clang 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 e50b320a0c..ee17a862b1 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -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(S)) { // FIXME: Handle enums.