Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AST] Refine the condition for element-dependent array fillers
This patch fixes clang to not consider braced initializers for aggregate elements of arrays to be potentially dependent on the indices of the initialized elements. Resolves bug 18978: initialize a large static array = clang oom? https://bugs.llvm.org/show_bug.cgi?id=18978 Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325120
- Loading branch information
Ivan A. Kosarev
committed
Feb 14, 2018
1 parent
1768957
commit 01df519
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// RUN: %clang_cc1 -S -o %t.ll -mllvm -debug-only=exprconstant %s 2>&1 | \ | ||
// RUN: FileCheck %s | ||
|
||
struct S { int i; }; | ||
|
||
static struct S arr[100000000] = {{ 0 }}; | ||
// CHECK: The number of elements to initialize: 1. | ||
|
||
struct S *foo() { return arr; } |