[Issue 15043] New: [e2ir] dmd still crashes when trying to set a delegate from __traits(getOverloads)

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 11 14:00:28 PDT 2015


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

          Issue ID: 15043
           Summary: [e2ir] dmd still crashes when trying to set a delegate
                    from __traits(getOverloads)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: bb.temp at gmx.com

the following program compiled without any particular switch

---
class Foo
{
    uint bar(){return 0;}
    this()
    {
        foreach(member; __traits(allMembers, typeof(this)))
            foreach(overload; __traits(getOverloads, typeof(this), member)) 
                static if (member == "bar")
                    setDg(&overload);
    }      
    void setDg(uint delegate() dg){}
}

void main(){}
---

crashes DMD and outputs:

> Error: delegates are only for non-static functions
> Assertion failure: '(int)vindex >= 0' on line 3439 in file 'e2ir.c'

- The bug looks highly related to
https://issues.dlang.org/show_bug.cgi?id=13920.
- The bug only produces a messages since 2.068, previously it was only crashing
without any helpful dignostic message.

--


More information about the Digitalmars-d-bugs mailing list