www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4983] New: Stack overflow while initializing struct member with address of one of its methods

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4983

           Summary: Stack overflow while initializing struct member with
                    address of one of its methods
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: 2korden gmail.com



---
struct Foo
{
    void bar()
    {
    }

    void delegate() dg = &Foo.init.bar;
}


Stack overflow

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 02 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4983


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com
           Severity|normal                      |minor



PDT ---
This is a recursive definition, I guess this should be expected. Lowering to
minor issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4983


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh gmail.com
           Severity|minor                       |normal



11:51:17 PDT ---
Compier stackoverflows and segfaults are NOT minor issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4983


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Stack overflow while        |[ICE] Stack overflow while
                   |initializing struct member  |initializing struct member
                   |with address of one of its  |with address of one of its
                   |methods                     |methods
           Severity|normal                      |major



Changed importance to 'major'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 30 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4983




More simple case:

  struct Foo { int dg = &Foo.init; }

In AddrExp, compiler will try to convert Foo.init to lvalue with
Expression::toLvalue, but it is not possible, then try to output an error
message like "Foo(...) is not an lvalue".

But, the initializer of the field dg contains Foo.init itself. So it will
occurs *recursive printing*.

  Foo(Foo.init) -> Foo(Foo(Foo.init)) -> Foo(Foo(Foo(Foo.init))) ...

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