[Issue 12585] New: Regression(2.064): Segfault on lazy/catch/opIndex

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 15 17:20:43 PDT 2014


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

          Issue ID: 12585
           Summary: Regression(2.064): Segfault on lazy/catch/opIndex
           Product: D
           Version: unspecified
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: cbkbbejeap at mailinator.com

This segfaults on 2.064 and newer (worked on 2.063.2):

-----------------------------------
struct Bar
{
    int opIndex(size_t index)
    {
        return 0;
    }
}

struct Foo
{
    Bar opIndex(size_t index)
    {
        throw new Exception("Fail");
    }
}

Foo foo()
{
    return Foo();
}

void catchStuff(E)(lazy E expression)
{
    try
        expression();
    catch(Exception e) {}
}

void main()
{
    catchStuff(foo[0][0]);
}
-----------------------------------

On windows, adding dummy members to struct Foo leads to slightly different
forms of crashing. Might be some sort of memory corruption.

--


More information about the Digitalmars-d-bugs mailing list