forked from OSchip/llvm-project
Check for null ObjCInterfaceDecls returned from getClassInterface() when generating USRs. While I have no test case for this (could not create one), this shows up in crash reports. Tentatively fixes <rdar://problem/8452791>.
llvm-svn: 114392
This commit is contained in:
parent
e3d864b857
commit
c2eb0116cc
|
@ -286,10 +286,17 @@ void USRGenerator::VisitObjCMethodDecl(ObjCMethodDecl *D) {
|
|||
do {
|
||||
if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(container))
|
||||
if (CD->IsClassExtension()) {
|
||||
Visit(CD->getClassInterface());
|
||||
break;
|
||||
}
|
||||
Visit(cast<Decl>(D->getDeclContext()));
|
||||
// ID can be null with invalid code.
|
||||
if (ObjCInterfaceDecl *ID = CD->getClassInterface()) {
|
||||
Visit(ID);
|
||||
break;
|
||||
}
|
||||
// Invalid code. Can't generate USR.
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Visit(container);
|
||||
}
|
||||
while (false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue