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 | d25c2194757f92a20ced4fe8f8833894ac5dab4e (patch) | |
| tree | 36373255277ae97828ff548c997a47c2b04a6102 | |
| parent | 50b293d65e6d27da95a9b89a622ae68235ecb636 (diff) | |
| download | bcm5719-llvm-d25c2194757f92a20ced4fe8f8833894ac5dab4e.tar.gz bcm5719-llvm-d25c2194757f92a20ced4fe8f8833894ac5dab4e.zip  | |
Fixe a crash in encoding of SEL type caused by recent changes.
llvm-svn: 89696
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 | ||||
| -rw-r--r-- | clang/test/CodeGenObjC/encode-test.m | 2 | 
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 7422ca85973..dd9fce90e03 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/test/CodeGenObjC/encode-test.m b/clang/test/CodeGenObjC/encode-test.m index 6665cb9d584..7aca79a8f38 100644 --- a/clang/test/CodeGenObjC/encode-test.m +++ b/clang/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; };  | 

