Bug 9254 – ICE on invalid foreach aggregate

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-01T12:41:00Z
Last change time
2013-01-04T10:43:33Z
Keywords
ice, pull
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2013-01-01T12:41:19Z
The following: void main(){ foreach(divisor; !(2, 3, 4, 8, 7, 9)) foreach(v; 0..uint.max)//comment this out and it compiles { } } Crashes DMD 2.061beta with: fastdiv.d(79): Error: invalid foreach aggregate false Assertion failure: '0' on line 2660 in file 'statement.c' abnormal program termination 2.060 produces same results.
Comment #1 by k.hara.pg — 2013-01-03T05:24:24Z
Comment #2 by github-bugzilla — 2013-01-04T00:48:23Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3a036842048beba5543f98c054b9fa30a1910c17 fix Issue 9254 - ICE on invalid foreach aggregate ForeachRangeStatement and WhileStatement are basically replaced into ForStatement in semantic phase. If any error occurs, they will be left as is, however. Therefor, `assert(0)` in blockExit, usesEH, comeFrom have the potential to be invoked. https://github.com/D-Programming-Language/dmd/commit/f762d5920e5b0b03753bfa3aab82c71ec90cb876 Merge pull request #1430 from 9rnsr/fix9254 Issue 9254 - ICE on invalid foreach aggregate