www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15989] New: Win32 optimizer bug


          Issue ID: 15989
           Summary: Win32 optimizer bug
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: dmitry.olsh gmail.com

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();

May 03 2016