Bug 11885 – ICE(s2ir.c 359) with continuing a labeled ByLine (range struct w/ dtor) loop

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-09T03:52:00Z
Last change time
2014-04-11T01:41:42Z
Keywords
ice, pull
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2014-01-09T03:52:38Z
Simple test case: //////////////////////////////////////////////////////////// import std.stdio; void main() { File f; l: foreach (i; f.byLine) continue l; } //////////////////////////////////////////////////////////// Reduced test case: //////////////////////////////////////////////////////////// struct ByLine { @property empty() { return false; } char[] front() { return null; } void popFront() { } ~this() { } } void main() { l: foreach (i; ByLine()) continue l; } //////////////////////////////////////////////////////////// Although in the test cases the struct is a temporary, it doesn't matter - DMD ICEs even if it's a global.
Comment #1 by yebblies — 2014-02-06T22:49:28Z
Reduced: void main() { l: for (auto x = ByLine();;) continue l; } Which gets transformed to this: void main() { l: { ByLine x = ByLine(); try { for (;;) { continue l; } } finally { x.~this(); } } return 0; } And now the l: is not on the for loop any more.
Comment #2 by k.hara.pg — 2014-04-10T09:23:40Z
Comment #3 by github-bugzilla — 2014-04-11T01:41:42Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/020f9f95b94e7379675b06bbc8ab1845ebf7db30 fix Issue 11885 - ICE(s2ir.c 359) with continuing a labeled ByLine (range struct w/ dtor) loop https://github.com/D-Programming-Language/dmd/commit/5cded0c6abe97353efa08ac06c9159772b4acf6e Merge pull request #3446 from 9rnsr/fix11885 Issue 11885 - ICE(s2ir.c 359) with continuing a labeled ByLine (range struct w/ dtor) loop