void[] f = cast(void[-1]) "a";
And adjusting the size of the static array instead causes a memory allocation failed ICE. Meaning that the first test triggers an integer overflow. void[] f = cast(void[-2]) "a";
Casting to void[uint.max] causes a segmentation fault in another part of the compiler. void[] f = cast(void[uint.max]) "a";
Casting to void[int.max] causes the backend to run out of memory. void[] f = cast(void[int.max]) "a";
@ibuclaw created dlang/dmd pull request #9840 "fix Issue 19890 - ICE: Segmentation fault with negative array size" fixing this issue: - fix Issue 19890 - ICE: Segmentation fault with negative array size https://github.com/dlang/dmd/pull/9840
dlang/dmd pull request #9840 "fix Issue 19890 - ICE: Segmentation fault with negative array size" was merged into master: - fb7814cc95e504503f6d6f94f3fc4ed2b73715b7 by Iain Buclaw: fix Issue 19890 - ICE: Segmentation fault with negative array size https://github.com/dlang/dmd/pull/9840
dlang/dmd pull request #10007 "[dmd-cxx] fix Issue 19890 - ICE: Segmentation fault with negative array size" was merged into dmd-cxx: - 789cf579d506e3b021d9beb47bf43b36bdb629d8 by Iain Buclaw: fix Issue 19890 - ICE: Segmentation fault with negative array size https://github.com/dlang/dmd/pull/10007