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 | d4879414f400fbc2538eaa84d19a3a3fba690937 (patch) | |
tree | 59aad8b6a0e3a5d4bd7d902025391957d88155ce /clang/lib/AST/ASTContext.cpp | |
parent | 9d0a11d9a10e29d39e6f4801aab7c4a7aa951c0c (diff) | |
download | bcm5719-llvm-d4879414f400fbc2538eaa84d19a3a3fba690937.tar.gz bcm5719-llvm-d4879414f400fbc2538eaa84d19a3a3fba690937.zip |
blocks: fixes a crash when encoding block type
with argument type of size 0. // rdar://11777609
PR13229.
llvm-svn: 159477
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 916e7d796fb..248698f45a1 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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; } |