Fix crash in code completion when an ObjCMethodDecl doesn't have an associated @interface.
Fixes <rdar://problem/8026215>. llvm-svn: 105256
This commit is contained in:
@@ -1573,10 +1573,13 @@ static void AddOrdinaryNameResults(Action::CodeCompletionContext CCC,
|
||||
|
||||
if (SemaRef.getLangOptions().ObjC1) {
|
||||
// Add "super", if we're in an Objective-C class with a superclass.
|
||||
if (ObjCMethodDecl *Method = SemaRef.getCurMethodDecl())
|
||||
if (Method->getClassInterface()->getSuperClass())
|
||||
Results.AddResult(Result("super"));
|
||||
|
||||
if (ObjCMethodDecl *Method = SemaRef.getCurMethodDecl()) {
|
||||
// The interface can be NULL.
|
||||
if (ObjCInterfaceDecl *ID = Method->getClassInterface())
|
||||
if (ID->getSuperClass())
|
||||
Results.AddResult(Result("super"));
|
||||
}
|
||||
|
||||
AddObjCExpressionResults(Results, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user