www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2064] New: Dmd faults

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

           Summary: Dmd faults
           Product: D
           Version: 2.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: bartosz relisoft.com


This (incorrect) program causes the compiler to fault.

import std.stdio;
import std.string;
void main ()
{
        string s = "abc";
        mixin ("foreach (c; s)");
        {
                writeln (c);
        }
}


-- 
May 02 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2064


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
            Summary|Dmd faults                  |Segfault with
                   |                            |mixin(for/foreach) with
                   |                            |empty loop body





Reduced test case, shows that the problem is a for/foreach with empty body.
I've changed the bug title accordingly. Also happens on dmd 1.031.

----
void main ()
{
        mixin (`for(;;)`);
}
---
bug.d(3): found 'EOF' instead of statement
then segfaults.


-- 
Jun 23 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2064


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch





statement.c,  in Statement *ForStatement::semantic(Scope *sc)

around line 1129. body = body->semantic(sc);
but body is null in this case.

Trivial fix:

    if (body) body = body->semantic(sc);


-- 
Apr 03 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2064


clugdbug yahoo.com.au changed:

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





Fixed DMD2.028


-- 
Apr 17 2009