From 00eb2b47bef2f7c89fed207aea90bdc5e53dfecc Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 13 Jun 2018 02:06:28 +0000 Subject: 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 --- lib/CodeGen/CGExprAgg.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/CodeGen/CGExprAgg.cpp') 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(E); + while (ILE && ILE->isTransparent()) + ILE = dyn_cast(ILE->getInit(0)); if (!ILE || !CGF.getTypes().isZeroInitializable(ILE->getType())) return CGF.getContext().getTypeSizeInChars(E->getType()); -- cgit v1.2.1