[phobos] Commit 1717 broke Phobos unittests

Andrei Alexandrescu andrei at erdani.com
Sat Aug 7 22:13:06 PDT 2010


I do. After you svn up your tree, try this code:

import std.conv;

// @@@BUG@@@ the size of China
void main() {
     auto i = 2;
     assert(parse!int("0",i) == 0);
}

The code should not even compile because it passes a string literal by 
reference. It segfaults.


Andrei

On 08/06/2010 01:22 PM, Don Clugston wrote:
> Do you have a reduced test case? It's happening in Array!bool, after
> the end of the first unittest which calls insertBack(). That happens
> to be the unittest after empty().
>
> I've been working on the wrong-code compiler bugs. This seems to be
> one of the worst.
>
> On 6 August 2010 17:52, Andrei Alexandrescu<andrei at erdani.com>  wrote:
>> That is a bug in the compiler. The compiler should never copy the return of
>> a stack variable or parameter - it should just bitblt them. That's not an
>> optimization, it's a language definition thing.
>>
>> Andrei
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list