}
void handleTopLevelDecl(Decl *D) {
+ if (!D)
+ return;
+
// FIXME: Currently ObjC method declarations are incorrectly being
// reported as top-level declarations, even though their DeclContext
// is the containing ObjC @interface/@implementation. This is a
Actions.DefaultSynthesizeProperties(getCurScope(), ObjCImpDecl);
for (size_t i = 0; i < LateParsedObjCMethods.size(); ++i) {
Decl *D = ParseLexedObjCMethodDefs(*LateParsedObjCMethods[i]);
- DeclsInGroup.push_back(D);
+ if (D)
+ DeclsInGroup.push_back(D);
}
DeclsInGroup.push_back(ObjCImpDecl);
--- /dev/null
+struct {
+
+@implementation Foo
+
+- (void)finalize {
+ NSLog(@"bar");
+}
+
+- (NSArray *)graphics {
+}
+
+@end
+
+// Test that we don't crash
+// RUN: c-index-test -test-load-source-reparse 3 local %s