http://d.puremagic.com/issues/show_bug.cgi?id=4036

           Summary: Segfault with -inline and literal of struct containing
                    union
           Product: D
           Version: 1.057
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: matti.niemenmaa+dbugzi...@iki.fi


--- Comment #0 from Matti Niemenmaa <matti.niemenmaa+dbugzi...@iki.fi> 
2010-04-01 05:34:25 PDT ---
struct XY { union { int x, y; } }
struct AHolder {
    XY aa;
    void a(XY x) { aa = x; }
}
struct AB {
    AHolder aHolder;
    XY b;
    void a(XY x) { aHolder.a(x); }
}
struct Main {
    AB ab;

    void setB() { ab.b = XY(); }
    void f() {
        ab.a(XY.init);
        setB();
    }
}

$ dmd -c -inline arst.d
Segmentation fault

Any of the following semantics-preserving changes will fix it:

- Making Main.setB use XY.init instead of XY()
- Inlining ab.a(XY.init) into Main.f
- Inlining setB() into Main.f
- Inlining aHolder.a(x) into AB.a

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to