From 271b8d43cea23d669e6a53410a94a4f948bfde36 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 29 Jun 2012 22:54:56 +0000 Subject: objective-c IRGen: fixes a crash when method type is being mangled when an argument type size is 0. // rdar://11777609, PR13229 llvm-svn: 159472 --- clang/lib/AST/ASTContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'clang/lib/AST/ASTContext.cpp') diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index f208f06111e..916e7d796fb 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -4190,8 +4190,8 @@ bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, QualType PType = (*PI)->getType(); CharUnits sz = getObjCEncodingTypeSize(PType); if (sz.isZero()) - return true; - + continue; + assert (sz.isPositive() && "getObjCEncodingForFunctionDecl - Incomplete param type"); ParmOffset += sz; @@ -4259,8 +4259,8 @@ bool ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, QualType PType = (*PI)->getType(); CharUnits sz = getObjCEncodingTypeSize(PType); if (sz.isZero()) - return true; - + continue; + assert (sz.isPositive() && "getObjCEncodingForMethodDecl - Incomplete param type"); ParmOffset += sz; -- cgit v1.2.3