https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90559

            Bug ID: 90559
           Summary: Out of memory because of negative length
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Some variations with negative length :

$ cat z1.d
int[0][-1] a;

$ cat z2.d
int[-1][0] a;

$ cat z3.d
int[-1][-1] a;


$ gdc-10-20190519 -c z1.d
d21: out of memory allocating 18446744073709551608 bytes after a total of
3334144 bytes


$ gdc-10-20190519 -c z3.d
z3.d:1:13: error: int[18446744073709551615LU] size 4 * 18446744073709551615
exceeds 0x7fffffffffffffff size limit for static array
    1 | int[-1][-1] a;
      |             ^
z3.d:1:13: error: int[18446744073709551615LU] size 4 * 18446744073709551615
exceeds 0x7fffffffffffffff size limit for static array
    1 | int[-1][-1] a;
      |             ^

Reply via email to