digitalmars.D.bugs - [Issue 1696] New: for(;;) in CTFE segfaults compiler
- d-bugmail puremagic.com (25/25) Nov 28 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1696
- Ary Borenszweig (4/34) Nov 28 2007 What if there is a break somewhere in the empty for? The compiler can't
- d-bugmail puremagic.com (12/12) Nov 28 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1696
- Ary Borenszweig (1/1) Nov 28 2007 Sorry, I meant nothing. I was very drowsy I guess.
- d-bugmail puremagic.com (9/9) Dec 09 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1696
http://d.puremagic.com/issues/show_bug.cgi?id=1696 Summary: for(;;) in CTFE segfaults compiler Product: D Version: 1.023 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: clugdbug yahoo.com.au Seems it's not checking for an empty iteration clause. Putting _anything_ in there, eg for(;;null) stops the segfault. --------- int a() { bool b = false; for (;;) { if (b) return 0; b = true; } } const c = a(); --
Nov 28 2007
d-bugmail puremagic.com wrote:http://d.puremagic.com/issues/show_bug.cgi?id=1696 Summary: for(;;) in CTFE segfaults compiler Product: D Version: 1.023 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: clugdbug yahoo.com.au Seems it's not checking for an empty iteration clause. Putting _anything_ in there, eg for(;;null) stops the segfault. --------- int a() { bool b = false; for (;;) { if (b) return 0; b = true; } } const c = a();What if there is a break somewhere in the empty for? The compiler can't know that the function will end it's execution. I think it would be weird if the compiler didn't hang up or segfault on this.
Nov 28 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1696 smjg iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg iname.com Keywords| |ice-on-valid-code ------- Comment #2 from smjg iname.com 2007-11-28 08:25 ------- Ary, what do you mean by this? And please don't quote the entire message posted to the newsgroup when replying. It's bad enough on any newsgroup, and when it clutters up Bugzilla, it's even worse. --
Nov 28 2007
Sorry, I meant nothing. I was very drowsy I guess.
Nov 28 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1696 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #4 from davidl 126.com 2007-12-09 19:17 ------- *** This bug has been marked as a duplicate of 1072 *** --
Dec 09 2007