[Issue 1072] this code should run as the same as previous bug code , but dmd av here
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Sep 15 09:33:46 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1072
------- Comment #2 from davidl at 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;
--
More information about the Digitalmars-d-bugs
mailing list