Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 28, 2007 [Issue 1696] New: for(;;) in CTFE segfaults compiler | ||||
---|---|---|---|---|
| ||||
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(); -- |
November 28, 2007 Re: [Issue 1696] New: for(;;) in CTFE segfaults compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | 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.
|
November 28, 2007 [Issue 1696] for(;;) in CTFE segfaults compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | 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. -- |
November 28, 2007 Re: [Issue 1696] for(;;) in CTFE segfaults compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | Sorry, I meant nothing. I was very drowsy I guess. |
December 10, 2007 [Issue 1696] for(;;) in CTFE segfaults compiler | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | 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 *** -- |
Copyright © 1999-2021 by the D Language Foundation