digitalmars.D.bugs - [Issue 7894] New: [CTFE] - goto within ForStatement restarts loop
- d-bugmail puremagic.com (33/33) Apr 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7894
- d-bugmail puremagic.com (21/21) Jul 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7894
- d-bugmail puremagic.com (9/9) Jul 14 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7894
- d-bugmail puremagic.com (10/10) Jul 14 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7894
http://d.puremagic.com/issues/show_bug.cgi?id=7894 Summary: [CTFE] - goto within ForStatement restarts loop Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dawg dawgfoto.de --- Comment #0 from dawg dawgfoto.de 2012-04-12 15:25:07 PDT --- cat > bug.d << CODE int foo() { foreach(v; 0 .. 2) { auto n = v; Lagain: if (n--) goto Lagain; } return 0; } enum ctfe = foo(); CODE dmd -c bug.d -------- This will loop endlessly because the loop initializer is reinterpreted after each goto. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7894 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug yahoo.com.au --- Comment #1 from Don <clugdbug yahoo.com.au> 2012-07-09 01:28:00 PDT --- Slightly reduced test case: int bug7894() { for (int k = 0; k < 2; ++k) { goto Lagain; Lagain: ; } return 1; } static assert( bug7894() ); Actually the loop initializer isn't reinterpreted after each goto. What's happening is that the increment is skipped. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 09 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7894 --- Comment #2 from github-bugzilla puremagic.com 2012-07-14 13:03:37 PDT --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9d6bc4560c3554b866f4bc8c6ace50b56c091953 Fix issue 7894 [CTFE] - goto within ForStatement restarts loop Also fixes a very similar bug in do-while loops -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 14 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7894 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 14 2012