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

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

https://gcc.gnu.org/g:0209b0ead2617d9226ef53d4fc4756d11dd6ea59

commit r10-9061-g0209b0ead2617d9226ef53d4fc4756d11dd6ea59
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/pr97889.d: New test.

    (cherry picked from commit 23045f8b062e20672f5170fc66532de7a5d9a1d6)

Reply via email to