From 333e44c91000c4b7d6a3dc5f79e04358dc78ad3a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 7 May 2013 20:37:17 +0000 Subject: [PATCH] [libclang] Add a null check in CursorVisitor::visitPreprocessedEntities. rdar://13680583 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181352 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/libclang/CIndex.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index a43c1ab7e4..c25e625df5 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -426,6 +426,9 @@ bool CursorVisitor::visitPreprocessedEntities(InputIterator First, continue; PreprocessedEntity *PPE = *First; + if (!PPE) + continue; + if (MacroExpansion *ME = dyn_cast(PPE)) { if (Visit(MakeMacroExpansionCursor(ME, TU))) return true; -- 2.40.0