[Issue 7784] New: stack overflow in Expression::apply with cyclic references

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 26 17:52:39 PDT 2012


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: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at 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: -------


More information about the Digitalmars-d-bugs mailing list