diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-06-13 02:06:28 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-06-13 02:06:28 +0000 |
| commit | 00eb2b47bef2f7c89fed207aea90bdc5e53dfecc (patch) | |
| tree | 70dee65c2579d36a5395bba8b8e789e4e7b27342 /lib/CodeGen/CGExprAgg.cpp | |
| parent | 078d5aacfa9d385b8689cec8f0e6f60e38db89ce (diff) | |
| download | clang-00eb2b47bef2f7c89fed207aea90bdc5e53dfecc.tar.gz | |
Fix crash emitting transparent list initializer for a large aggregate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 41e32a9d60..d350a86a11 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -1673,6 +1673,8 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { // If this is an initlist expr, sum up the size of sizes of the (present) // elements. If this is something weird, assume the whole thing is non-zero. const InitListExpr *ILE = dyn_cast<InitListExpr>(E); + while (ILE && ILE->isTransparent()) + ILE = dyn_cast<InitListExpr>(ILE->getInit(0)); if (!ILE || !CGF.getTypes().isZeroInitializable(ILE->getType())) return CGF.getContext().getTypeSizeInChars(E->getType()); |
