]> granicus.if.org Git - clang/commitdiff
Fixe a crash in encoding of SEL type caused by recent changes.
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Nov 2009 20:40:50 +0000 (20:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 23 Nov 2009 20:40:50 +0000 (20:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89696 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp
test/CodeGenObjC/encode-test.m

index 7422ca8597366b6a95cae7f8f51617c34469da2b..dd9fce90e03313308c0d73e85bfd6b828d6fbc75 100644 (file)
@@ -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
index 6665cb9d584bcd3600b0cd56e051409c9fa21a2f..7aca79a8f38fd657ac75633c58f085037870ec91 100644 (file)
@@ -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; };