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





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






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





*** 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





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             |





-------
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






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





Fixed dmd 1.026


-- 
Feb 16 2008