diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-23 20:40:50 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-11-23 20:40:50 +0000 |
commit | 60bce3ef20a4c9684e3825cdd739fefb9810327d (patch) | |
tree | 0aea7bd3cd7243f3ed322a657ba16cfe04937787 | |
parent | bc0e0781da778bd5eb41a810419912893ae20448 (diff) |
Fixe a crash in encoding of SEL type caused by recent changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89696 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/AST/ASTContext.cpp | 9 | ||||
-rw-r--r-- | test/CodeGenObjC/encode-test.m | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 7422ca8597..dd9fce90e0 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3396,6 +3396,11 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, false); return; } + + if (isObjCSelType(T)) { + S += ':'; + return; + } if (const PointerType *PT = T->getAs<PointerType>()) { QualType PointeeTy = PT->getPointeeType(); @@ -3429,10 +3434,6 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, S.replace(S.end()-2, S.end(), replace); } } - if (isObjCSelType(PointeeTy)) { - S += ':'; - return; - } if (PointeeTy->isCharType()) { // char pointer types should be encoded as '*' unless it is a diff --git a/test/CodeGenObjC/encode-test.m b/test/CodeGenObjC/encode-test.m index 6665cb9d58..7aca79a8f3 100644 --- a/test/CodeGenObjC/encode-test.m +++ b/test/CodeGenObjC/encode-test.m @@ -68,10 +68,12 @@ struct Innermost { int ivar; } -(void) test3: (Test* [3] [4])b ; +- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3; @end @implementation Test -(void) test3: (Test* [3] [4])b {} +- (SEL**) meth : (SEL) arg : (SEL*****) arg1 : (SEL*)arg2 : (SEL**) arg3 {} @end struct S { int iS; }; |