[dmd-beta] dmd 1.069 and 2.054 beta

Don Clugston dclugston at googlemail.com
Fri Jul 8 05:56:59 PDT 2011


On 8 July 2011 10:56, Stephan Dilly <Dilly at funatics.de> wrote:
> I found another problem, that i think that was not present in the last
> release:

Clearly it's CTFE not respecting .dup in certain circumstances.
But it behaved the same way in 2.053. In 2.052, it prints:
literal:CL_INVALID_CONTEXT
mutated:_INVALID_CONTEXT
literal:CL_INVALID_CONTEXT
because the foreach ref was simply ignored.
So it's not a regression. Instead, one form of wrong code was replaced
with another.
I'll be on holidays for the next two weeks and will not be online, so
I don't have time to fix this anyway.

>
> string mutateTheImmutable(immutable string _s)
> {
>    char[] s = _s.dup;
>
>    foreach(ref c; s)
>        c = 'x';
>
>    return s.idup;
> }
>
> string doharm(immutable string _name)
> {
>    return mutateTheImmutable(_name[2..$].idup);
> }
>
> enum literal = "CL_INVALID_CONTEXT";
> pragma(msg, "literal:" ~ literal);
>
> enum foo = doharm(literal);
>
> pragma(msg, "mutated:" ~ foo);
> pragma(msg, "literal:" ~ literal);
>
> void main(){}
>
>
> dmd messages:
> literal:CL_INVALID_CONTEXT
> mutated:xxxxxxxxxxxxxxxx
> literal:CLxxxxxxxxxxxxxxxx
>
>
> Is this behaviour by design ??
>
>
>
> On 08.07.2011 00:50, David Simcha wrote:
>>
>> I Isolated the other regression that I mentioned this morning.  It's one
>> that I don't think anyone else is likely to run into and I wouldn't be at
>> all annoyed if we just released with it.
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=6267
>>
>> On 7/5/2011 10:31 PM, Walter Bright wrote:
>>>
>>> http://ftp.digitalmars.com/dmd1beta.zip
>>> http://ftp.digitalmars.com/dmd2beta.zip
>>> _______________________________________________
>>> dmd-beta mailing list
>>> dmd-beta at puremagic.com
>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>>
>>
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>>
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>


More information about the dmd-beta mailing list