From: Zhongxing Xu Date: Mon, 20 Jul 2009 08:28:49 +0000 (+0000) Subject: The children statements might be NULL. Check for this case in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89021b0c71c53c88927b588431859a041bec2802;p=clang The children statements might be NULL. Check for this case in isContainedInStatement(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76408 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp index 84d79363ef..e869707f4d 100644 --- a/lib/Index/ASTLocation.cpp +++ b/lib/Index/ASTLocation.cpp @@ -51,8 +51,9 @@ static bool isContainedInStatement(Stmt *Node, Stmt *Parent) { for (Stmt::child_iterator I = Parent->child_begin(), E = Parent->child_end(); I != E; ++I) { - if (isContainedInStatement(Node, *I)) - return true; + if (*I) + if (isContainedInStatement(Node, *I)) + return true; } return false;