]> granicus.if.org Git - clang/commit
For
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 21 Apr 2011 00:27:41 +0000 (00:27 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 21 Apr 2011 00:27:41 +0000 (00:27 +0000)
commit4423ac0282acb8ba801eb05b38712438dc0c1e3e
tree7240b822a3e076a933662a79868b24405211f569
parente0047b13f0025fa1588f1b776592ed3458b226d6
For

double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129896 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Expr.h
lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGExprConstant.cpp
lib/Sema/SemaInit.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
test/Index/initializer-memory.cpp [new file with mode: 0644]