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

            Bug ID: 97889
           Summary: d: OutOfMemoryError thrown when appending to an array
                    with a side effect
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

Similar to pr97843.

The following program results in OutOfMemoryError being raised.

auto mul11ret3(T)(ref T s)
{
    s ~= 11;
    return [3];
}

void main()
{
    static auto test3(int[] val) { (val ~= 7) ~= mul11ret3(val); return val; }
    assert(test3([2]) == [2,7,11,3]);
}

Reply via email to