From 18a11e33ea4f19d17f84e2d9f375ef08c25ca85b Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Wed, 11 Apr 2012 21:48:13 +0000 Subject: [PATCH] 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 --- .../clang.check-definition-for-superclasses.diff | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lldb/scripts/clang.check-definition-for-superclasses.diff diff --git a/lldb/scripts/clang.check-definition-for-superclasses.diff b/lldb/scripts/clang.check-definition-for-superclasses.diff new file mode 100644 index 000000000000..566c518c1971 --- /dev/null +++ b/lldb/scripts/clang.check-definition-for-superclasses.diff @@ -0,0 +1,15 @@ +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; + -- GitLab