Thread overview
[Issue 7784] New: stack overflow in Expression::apply with cyclic references
Mar 27, 2012
dawg@dawgfoto.de
[Issue 7784] ICE with self-referencing literals
Apr 15, 2012
Walter Bright
March 27, 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@puremagic.com
        ReportedBy: dawg@dawgfoto.de


--- Comment #0 from dawg@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: -------
April 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7784



--- Comment #2 from github-bugzilla@puremagic.com 2012-04-14 18:40:39 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/91f3179ea3e9b622e79ebc6b31b66236f1363964 Fix issue 7784 CTFE ICE with self-referencing AA literals

https://github.com/D-Programming-Language/dmd/commit/b7fd092bdc4cc746995cf2c578c4c7bcbc3ebe56 Merge pull request #860 from donc/stackoverflow7784

Fix issue 7784 CTFE ICE with self-referencing AA literals

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7784


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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