Skip to content
Snippets Groups Projects
Commit 23045f8b authored by Iain Buclaw's avatar Iain Buclaw
Browse files

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.
parent c1fb592f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment