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




------- Comment #1 from clugdbug yahoo.com.au  2008-06-23 08:07 -------
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




------- Comment #2 from clugdbug yahoo.com.au  2009-04-03 06:30 -------
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




------- Comment #3 from clugdbug yahoo.com.au  2009-04-18 01:03 -------
Fixed DMD2.028


-- 
Apr 17 2009