llvm-capstone/lldb/scripts/clang.check-definition-for-superclasses.diff
Sean Callanan 18a11e33ea Fixed a crash in Clang when a superclass of an
Objective-C class doesn't have a definition but
Clang tries to read through its protocols anyway.

llvm-svn: 154538
2012-04-11 21:48:13 +00:00

16 lines
477 B
Diff

Index: lib/AST/DeclObjC.cpp
===================================================================
--- lib/AST/DeclObjC.cpp (revision 152265)
+++ lib/AST/DeclObjC.cpp (working copy)
@@ -330,6 +330,10 @@
LoadExternalDefinition();
while (ClassDecl != NULL) {
+ // FIXME: Should make sure no callers ever do this.
+ if (!ClassDecl->hasDefinition())
+ return 0;
+
if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
return MethodDecl;