[clang] [clang] Fix crash constant-evaluating the construction of huge arrays (PR #226899)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 1 18:53:57 PDT 2026
================
@@ -3033,6 +3042,8 @@ bool Compiler<Emitter>::VisitArrayInitLoopExpr(const ArrayInitLoopExpr *E) {
const Expr *SubExpr = E->getSubExpr();
OptPrimType SubExprT = classify(SubExpr);
size_t Size = E->getArraySize().getZExtValue();
----------------
shafik wrote:
So we are not being consistent here. We use `uint64_t` below but `size_t` here and we should not be using these interchangeably. I believe we should be using `uint64_t` here.
@tbaederr we are a bit sloppy in this function we are implicitly converting a `size_t` to `uint32_t` in a couple of cases below and we should be more explicit about that.
https://github.com/llvm/llvm-project/pull/226899
More information about the cfe-commits
mailing list