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

           Summary: stack overflow in Expression::apply with cyclic
                    references
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: d...@dawgfoto.de


--- Comment #0 from d...@dawgfoto.de 2012-03-26 17:53:04 PDT ---
cat > bug.d << CODE
struct Foo
{
    void bug()
    {
        // cyclic reference
        tab["A"] = Bar(&this);
        auto pbar = "A" in tab;
        // triggers stack overflow in Expression::apply for hasSideEffect
        auto bar = *pbar;
    }

    Bar[string] tab;
}

struct Bar
{
    Foo* foo;
    int val;
}

int ctfe()
{
    auto foo = Foo();
    foo.bug();
    return 0;
}

enum run = ctfe();
CODE

--------

We should probably flag all literal expression during visiting
and either skip them or return a different apply result.

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

Reply via email to