diff options
author | Fangrui Song <i@maskray.me> | 2024-05-17 10:59:39 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 10:59:39 -0700 |
commit | f7516c7f3f00fca7271056cc9abeda2da4687c17 (patch) | |
tree | 8d8d5f0f2f8a342f97c89d75bdd87da92fbb7972 /clang/lib/Sema/SemaInit.cpp | |
parent | e18c4838811f2a6f9592ddeaed585a3830ebc8aa (diff) | |
download | llvm-f7516c7f3f00fca7271056cc9abeda2da4687c17.zip llvm-f7516c7f3f00fca7271056cc9abeda2da4687c17.tar.gz llvm-f7516c7f3f00fca7271056cc9abeda2da4687c17.tar.bz2 |
[CodeGen] Support arrays with initializers of 64-bit size
Based on @OfekShochat's https://reviews.llvm.org/D133648
init.c is the primary test for array initialization, but it uses a
32-bit triple, which would lead to an "array is too large" error. Add
the new test to array-init.c instead.
Fix #57353
Pull Request: https://github.com/llvm/llvm-project/pull/92473
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 2177972..353e911 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -876,7 +876,7 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, InitializedEntity ElementEntity = Entity; unsigned NumInits = ILE->getNumInits(); - unsigned NumElements = NumInits; + uint64_t NumElements = NumInits; if (const ArrayType *AType = SemaRef.Context.getAsArrayType(ILE->getType())) { ElementType = AType->getElementType(); if (const auto *CAType = dyn_cast<ConstantArrayType>(AType)) @@ -896,7 +896,7 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity, ElementType = ILE->getType(); bool SkipEmptyInitChecks = false; - for (unsigned Init = 0; Init != NumElements; ++Init) { + for (uint64_t Init = 0; Init != NumElements; ++Init) { if (hadError) return; |