www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Druntime git HEAD broke array ops

reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
I wasted all day today trying to track down a sudden test suite breakage
in one of my major D projects after upgrading to the latest dmd
toolchain, and found that the latest druntime broke array operations:

	double[] src = [ 0.5 ];
	double[] dest;
	dest.length = src.length;
	dest[] = -src[];

The expected contents of dest is [ -0.5 ], but the actual result is
[ 0.0 ].

	https://issues.dlang.org/show_bug.cgi?id=19796

Git bisect narrowed down th


T

-- 
Windows: the ultimate triumph of marketing over technology. -- Adrian von Bidder
Apr 08
parent reply Seb <seb wilzba.ch> writes:
On Tuesday, 9 April 2019 at 04:35:33 UTC, H. S. Teoh wrote:
 I wasted all day today trying to track down a sudden test suite 
 breakage in one of my major D projects after upgrading to the 
 latest dmd toolchain, and found that the latest druntime broke 
 array operations:

 	double[] src = [ 0.5 ];
 	double[] dest;
 	dest.length = src.length;
 	dest[] = -src[];

 The expected contents of dest is [ -0.5 ], but the actual 
 result is [ 0.0 ].

 	https://issues.dlang.org/show_bug.cgi?id=19796

 Git bisect narrowed down th
 d7b99e91e).


 T
Thanks a lot for tracking that down. I'm amazed that all the testsuites didn't catch this. This should hopefully fix the problem: https://github.com/dlang/druntime/pull/2550
Apr 08
parent matheus <m g.com> writes:
On Tuesday, 9 April 2019 at 05:28:29 UTC, Seb wrote:
 ...
 This should hopefully fix the problem: 
 https://github.com/dlang/druntime/pull/2550
I was taking a looking over the fix: https://github.com/dlang/druntime/pull/2550/commits/4a79c5f95c3656c3523955b56ba9189c10f8fdb3 And the test case scenario is only one and exactly the problem pointed by H.S. Teoh. Wouldn't be better to take the change and adding more cases? For example, what would happen if it were more the one value in the array and some of the values were negative? I mean wouldn't be the case to expand the test case? Because the way it seems it was narrowed to the exactly problem and tomorrow other problems may appear. Matheus.
Apr 09