www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14853] New: DMD segfaults with the cast from mutable struct

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

          Issue ID: 14853
           Summary: DMD segfaults with the cast from mutable struct new to
                    shared
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

From: http://forum.dlang.org/thread/xupmxlqobvwvquznzdiw forum.dlang.org

Tweaked test case:

struct sQueue(T)
{
    struct sNode
    {
        T mfPayload = T.init;
        union
        {
                   typeof(this)*  mfPrev;
            shared(typeof(this)*) mfShPrev;
        }
        union
        {
                   typeof(this)*  mfNext;
            shared(typeof(this)*) mfShNext;
        }
    }

    sNode mfRoot;

    void pfPut(T v, sNode* r = null)
    {
        shared n = new sNode(v);    // problem!
    }
}

void main()
{
    auto b1 = new sQueue!uint;
}

--
Jul 31 2015