www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13861] New: compiler segfault with nested struct, cannot

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

          Issue ID: 13861
           Summary: compiler segfault with nested struct, cannot access
                    frame
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: vlevenfeld gmail.com

This code does not compile:

struct Foo (alias f, T)
{
    void bar () {} // BUG if not commented out, I get "Error: cannot access
frame pointer of test.N.Foo!((n) => n, ulong).Foo"
}

void main () {
    auto A = N;
    typeof (A) x;
}

static N () {return Foo!(n => n, size_t)();}

In addition, when I attempt to use the value of A instead of just taking the
typeof, I get a compiler segfault. Here is the backtrace:


    at func.c:4182

    fd=0x7ffff512a0c0) at toir.c:219

    ad=0x7ffff1bff500) at toir.c:300

    sle=0x7ffff084c6c0) at e2ir.c:5220

    v=0x7fffffffd9c0) at expression.h:493

    at e2ir.c:5247

    ce=0x7ffff084c820) at e2ir.c:3435

    v=0x7fffffffdb20) at expression.h:908

    at e2ir.c:5247

    at e2ir.c:5340

    s=0x7ffff0832d00) at s2ir.c:770


    at s2ir.c:1273

    s=0x7ffff0833a90) at s2ir.c:850

    v=0x7fffffffdd40) at statement.h:206

    at s2ir.c:1273

    s=0x7ffff088aca0) at s2ir.c:850

    v=0x7fffffffddd0) at statement.h:206

    at s2ir.c:1273

    multiobj=false) at glue.c:1222

    multiobj=false) at toobj.c:1168

    multiobj=false) at glue.c:383



--
Dec 14 2014