[clang] [clang][Sema] Avoid out-of-memory crash on huge designated initializer indices (PR #205503)

Max Manolov via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 14:47:45 PDT 2026


maxmanolov wrote:

Thanks! I've updated this to make the limit configurable with `-fmax-init-list-elements=<N>`. It defaults to `1048576`, matching the existing `-fconstexpr-steps` default, while retaining the non-configurable upper bound required by `resizeInits`’ representation. I added coverage for a lowered cc1 limit, driver forwarding, and the oversized-designator path. `ninja -C build clang` and the focused tests pass. Let me know if you'd prefer a different default or option spelling.

https://github.com/llvm/llvm-project/pull/205503


More information about the cfe-commits mailing list