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

          Issue ID: 15989
           Summary: Win32 optimizer bug
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

The test case below segfaults with -O but passes without it. Only Windows x86,
tested on DMD from the latest master.


struct Input{}

interface Kickstart{
bool opCall(ref Input );
}

struct Regex
{
    Kickstart kickstart;
}


auto regex()
{
    return Regex(new ShiftOr());
}


class ShiftOr : Kickstart
{
    bool opCall(ref Input )
    {
        return false;
    }
}

enum ctRegex = regex();

void main()
{
    auto r = ctRegex;
    auto s = Input();
    r.kickstart(s);
}

--

Reply via email to