www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1072] New: this code should run as the previous bug code , but dmd av here

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

           Summary: this code should run as the previous bug code , but dmd
                    av here
           Product: D
           Version: 1.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: davidl 126.com


static char[] hello()
{
        char[] result="";
        for(;;)
           result ~= `abc`;
        return result;
}
void main()
{
        pragma(msg,hello());
}

this code should also make ur computer DoS, but DMD AV


-- 
Mar 20 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #1 from thomas-dloop kuehne.cn  2007-04-04 15:36 -------
Added to DStress as
http://dstress.kuehne.cn/compile/a/array_initialization_33_A.d
http://dstress.kuehne.cn/compile/a/array_initialization_33_B.d
http://dstress.kuehne.cn/compile/a/array_initialization_33_C.d
http://dstress.kuehne.cn/compile/a/array_initialization_33_D.d
http://dstress.kuehne.cn/compile/a/array_initialization_33_E.d


-- 
Apr 04 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072





------- Comment #2 from davidl 126.com  2007-09-15 11:33 -------
this code won't make dmd access violation:
static char[] hello()
{
        char[] result="";
        int i;
        for(;;i++)
           result ~= `abc`;
        return result;
}
void main()
{
        pragma(msg,hello());
}

the problem is intepret.c line 594, it assumes increment is an object which is
never null, while in this case, the loop doesn't have any increment statement.
So a quick fix is 
add to line 594
                if (!increment)
                        continue;


-- 
Sep 15 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072


davidl 126.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au




------- Comment #3 from davidl 126.com  2007-12-09 19:17 -------
*** Bug 1696 has been marked as a duplicate of this bug. ***


-- 
Dec 09 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072


clugdbug yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code, patch




------- Comment #4 from clugdbug yahoo.com.au  2007-12-18 09:27 -------
added keywords. Walter probably missed this one because the bug title is
terrible!


-- 
Dec 18 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072


matti.niemenmaa+dbugzilla iki.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|this code should run as the |CTFE: crash on for loop with
                   |same as previous bug code , |blank increment
                   |but dmd av here             |




------- Comment #5 from matti.niemenmaa+dbugzilla iki.fi  2007-12-18 12:30
-------
So make it less terrible.


-- 
Dec 18 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072





------- Comment #6 from davidl 126.com  2007-12-19 04:54 -------
haha, you guys are right.


-- 
Dec 19 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1072


bugzilla digitalmars.com changed:

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




------- Comment #7 from bugzilla digitalmars.com  2008-02-16 06:08 -------
Fixed dmd 1.026


-- 
Feb 16 2008