diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-07-20 08:28:49 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-07-20 08:28:49 +0000 |
commit | 89021b0c71c53c88927b588431859a041bec2802 (patch) | |
tree | 9849c052b3db6fb7e6bffd09dc24e4d0a29db10c /lib/Index/ASTLocation.cpp | |
parent | b27ed3d731c8885bcb473efc734b817a1216b4fa (diff) |
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
Diffstat (limited to 'lib/Index/ASTLocation.cpp')
-rw-r--r-- | lib/Index/ASTLocation.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; |