[cfe-commits] r89696 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjC/encode-test.m

Fariborz Jahanian fjahanian at apple.com
Mon Nov 23 12:40:50 PST 2009


Author: fjahanian
Date: Mon Nov 23 14:40:50 2009
New Revision: 89696

URL: http://llvm.org/viewvc/llvm-project?rev=89696&view=rev
Log:
Fixe a crash in encoding of SEL type caused by recent changes.


Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/CodeGenObjC/encode-test.m

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=89696&r1=89695&r2=89696&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Mon Nov 23 14:40:50 2009
@@ -3396,6 +3396,11 @@
                                false);
     return;
   }
+  
+  if (isObjCSelType(T)) {
+    S += ':';
+    return;
+  }
 
   if (const PointerType *PT = T->getAs<PointerType>()) {
     QualType PointeeTy = PT->getPointeeType();
@@ -3429,10 +3434,6 @@
         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

Modified: cfe/trunk/test/CodeGenObjC/encode-test.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/encode-test.m?rev=89696&r1=89695&r2=89696&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenObjC/encode-test.m (original)
+++ cfe/trunk/test/CodeGenObjC/encode-test.m Mon Nov 23 14:40:50 2009
@@ -68,10 +68,12 @@
 	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; };





More information about the cfe-commits mailing list