[Issue 20900] dmd crashes on static foreach over infinite range
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 12 13:35:24 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=20900
--- Comment #1 from Bolpat <qs.il.paperinik at gmail.com> ---
I’d suggest DMD abort when a `static foreach` surpasses 2^16−1 (65,535)
iterations; also add a compiler switch (suggestion:
`-static-foreach-depth=<number>`) to change the aforementioned default for the
rare cases it’s needed. Alternatively, a `pragma` could work well, too.
--
More information about the Digitalmars-d-bugs
mailing list