diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-06-30 00:48:59 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-06-30 00:48:59 +0000 |
commit | 075a54354dc6e3644b12206e5127855091783fd6 (patch) | |
tree | 1dfc4ece805f96c69cbc21dc00bfeb4585eaa686 /lib/AST/ASTContext.cpp | |
parent | 1ba472303971739dbad1e3c73680f630e55b2394 (diff) |
blocks: fixes a crash when encoding block type
with argument type of size 0. // rdar://11777609
PR13229.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 916e7d796f..248698f45a 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -4149,6 +4149,8 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { E = Decl->param_end(); PI != E; ++PI) { QualType PType = (*PI)->getType(); CharUnits sz = getObjCEncodingTypeSize(PType); + if (sz.isZero()) + continue; assert (sz.isPositive() && "BlockExpr - Incomplete param type"); ParmOffset += sz; } |