зеркало из https://github.com/microsoft/clang-1.git
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114392 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2e81caa143
Коммит
c52d069277
|
@ -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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче