www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1437] New: dmd crash: "Internal error: ..\ztc\cod4.c 357"

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

           Summary: dmd crash: "Internal error: ..\ztc\cod4.c 357"
           Product: D
           Version: 1.020
          Platform: PC
               URL: http://paste.dprogramming.com/dpd76fe1
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: spam extrawurst.org


following code crashes the compiler while compiling with -O for optimization.

[CODE]
struct C {

    C copy() {

        C cpy;

        return cpy;
    }
}

void foo(C _c) {

    foo( _c.copy() );
}

void main() {

    C c;

    foo(c);
}
[/CODE]

crashes at least with dmd1.020 and dmd2.003.

compile call: "dmd -c -O main.d"
output: "Internal error: ..\ztc\cod4.c 357"

PS: i know this code is producing a stack overflow on runtime but thats not the
bug ;). i cant get in runtime when the compiler crashes.


-- 
Aug 21 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1437


spam extrawurst.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





fixed in dmd1.022 and dmd2.005


-- 
Oct 06 2007