diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-07 21:01:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-01-07 21:01:41 +0000 |
commit | 4b1e275eb743b46cd10153bb58743d89af7242ea (patch) | |
tree | dbfa7198846cee4ea2ddbd09421cce91e6c1a480 /lib/Sema/SemaExprObjC.cpp | |
parent | b0d27943e133f099a39abc26a49d1130b5a8f5af (diff) |
Don't ICE when messaging on 'super' receiver when class
of category implementation is undeclared. Issue error instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index e2825056c5..de99e182d6 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -190,10 +190,13 @@ Sema::ExprResult Sema::ActOnClassMessage( if (receiverName->isStr("super")) { if (getCurMethodDecl()) { isSuper = true; - ClassDecl = getCurMethodDecl()->getClassInterface()->getSuperClass(); + ObjCInterfaceDecl *OID = getCurMethodDecl()->getClassInterface(); + if (!OID) + return Diag(lbrac, diag::error_no_super_class_message) + << getCurMethodDecl()->getDeclName(); + ClassDecl = OID->getSuperClass(); if (!ClassDecl) - return Diag(lbrac, diag::error_no_super_class) - << getCurMethodDecl()->getClassInterface()->getDeclName(); + return Diag(lbrac, diag::error_no_super_class) << OID->getDeclName(); if (getCurMethodDecl()->isInstance()) { QualType superTy = Context.getObjCInterfaceType(ClassDecl); superTy = Context.getPointerType(superTy); |