Hardening so we won't crash if an Objective-C interface

doesn't have a corresponding type.

<rdar://problem/13596142>

llvm-svn: 179130
This commit is contained in:
Sean Callanan 2013-04-09 21:30:48 +00:00
parent 18785857d4
commit dfb87d616b
1 changed files with 3 additions and 0 deletions

View File

@ -2893,6 +2893,9 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context,
return;
const clang::Type *interface_type = self_interface->getTypeForDecl();
if (!interface_type)
return; // This is unlikely, but we have seen crashes where this occurred
TypeFromUser class_user_type(QualType(interface_type, 0).getAsOpaquePtr(),
&method_decl->getASTContext());