Fixes crash when visiting a partial AST after encountering
a parse error in the input code:
#5 clang::Stmt::getStmtClass (this=<optimized out>) at llvm-project/clang/include/clang/AST/Stmt.h:1125 #6 clang::cxcursor::MakeCXCursor (S=S@entry=0x0, Parent=0x0, TU=0x7f8c6c5186b0, RegionOfInterest=...) at llvm-project/clang/tools/libclang/CXCursor.cpp:132 #7 0x00007f8caddc96e5 in clang::cxcursor::CursorVisitor::EnqueueWorkList (this=this@entry=0x7f8c9bffc330, WL=..., S=S@entry=0x0) at llvm-project/clang/tools/libclang/CIndex.cpp:3028 #8 0x00007f8cadde4e2c in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7f8c9bffc330, S=0x0) at llvm-project/clang/tools/libclang/CIndex.cpp:3256 #9 0x00007f8cadde4604 in clang::cxcursor::CursorVisitor::RunVisitorWorkList (this=this@entry=0x7f8c9bffc330, WL=...) at llvm-project/clang/tools/libclang/CIndex.cpp:3214 #10 0x00007f8cadde4e37 in clang::cxcursor::CursorVisitor::Visit (this=this@entry=0x7f8c9bffc330, S=0x7f8c6c17dc30) at llvm-project/clang/tools/libclang/CIndex.cpp:3257 #11 0x00007f8cadddeccb in clang::cxcursor::CursorVisitor::VisitChildren (this=this@entry=0x7f8c9bffc330, Cursor=...) at llvm-project/clang/tools/libclang/CIndex.cpp:515 #12 0x00007f8cadde688f in clang_visitChildren (parent=..., visitor=0x7f8caef6ddda <(anonymous namespace)::visitCursor(CXCursor, CXCursor, CXClientData)>, client_data=0x7f8c9bffe3b0) at llvm-project/clang/tools/libclang/CIndex.cpp:4450