www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14595] New: RefCounted data corrupted when in an AA

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

          Issue ID: 14595
           Summary: RefCounted data corrupted when in an AA
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

/////////////// test.d //////////////
import std.typecons;

alias ObjectWriter = RefCounted!int;

ObjectWriter[string] writers;

void main()
{
    writers[null] = ObjectWriter(42);
    auto pwriter = null in writers;
    assert(*pwriter == 42);
}
/////////////////////////////////////

Assertion fails on Linux/64.

Introduced in https://github.com/D-Programming-Language/dmd/pull/3672

--
May 16 2015