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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>:

https://gcc.gnu.org/g:23045f8b062e20672f5170fc66532de7a5d9a1d6

commit r11-5239-g23045f8b062e20672f5170fc66532de7a5d9a1d6
Author: Iain Buclaw <ibuc...@gdcproject.org>
Date:   Sun Nov 22 14:29:54 2020 +0100

    d: Fix OutOfMemoryError thrown when appending to an array with a side
effect

    When appending a character to an array, the result of that concat
    assignment was not the new value of the array, similarly, when appending
    an array to another array, side effects were evaluated in reverse to the
    expected order of evaluation.

    As of this change, the address of the left-hand side expression is
    saved and re-used as the result.  Its evaluation is now also forced to
    occur before the concat operation itself is called.

    gcc/d/ChangeLog:

            PR d/97889
            * expr.cc (ExprVisitor::visit (CatAssignExp *)): Enforce LTR order
of
            evaluation on left and right hand side expressions.

    gcc/testsuite/ChangeLog:

            PR d/97889
            * gdc.dg/torture/pr97889.d: New test.

Reply via email to