Bug 13221 – [ICE] '0' on line 318 in file 'interpret.c'

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-28T11:26:00Z
Last change time
2014-08-22T08:05:06Z
Keywords
ice, pull
Assigned to
nobody
Creator
jblume

Comments

Comment #0 by jblume — 2014-07-28T11:26:21Z
import std.typecons; template test(T) {} void main() { foreach (r; 0 .. 0) { enum i = r; test!(Tuple!bool[i]); } } On v2.066.0-b6 this results in: main.d(9): Error: variable r cannot be read at compile time main.d(10): Error: CTFE internal error: ErrorExp in main.d(10) Assertion failure: '0' on line 318 in file 'interpret.c'
Comment #1 by k.hara.pg — 2014-07-29T09:26:51Z
(In reply to Johannes Blume from comment #0) > On v2.066.0-b6 this results in: > > main.d(9): Error: variable r cannot be read at compile time > main.d(10): Error: CTFE internal error: ErrorExp in main.d(10) > > Assertion failure: '0' on line 318 in file 'interpret.c' The ICE occurs from 2.064. With 2.062 -> no ICE $ dmd -o- test test.d(9): Error: variable r cannot be read at compile time test.d(10): Error: Integer constant expression expected instead of cast(int)r With 2.063 -> no ICE $ dmd -o- test test.d(9): Error: variable r cannot be read at compile time C:\dmd2.063\src\phobos\std\range.d(611): Error: static assert "Cannot put a char[] into a Appender!(string)" C:\dmd2.063\src\phobos\std\format.d(1433): instantiated from here: put!(Appender!(string), char[]) C:\dmd2.063\src\phobos\std\format.d(1335): instantiated from here: formatUnsigned!(Appender!(string), char) C:\dmd2.063\src\phobos\std\format.d(1309): instantiated from here: formatIntegral!(Appender!(string), ulong, char) C:\dmd2.063\src\phobos\std\format.d(2950): ... (3 instantiations, -v to show) ... C:\dmd2.063\src\phobos\std\typecons.d(326): instantiated from here: format!(char, uint, uint) test.d(10): instantiated from here: Tuple!(bool) With 2.064, and 2.065 -> ICE
Comment #2 by k.hara.pg — 2014-07-29T09:29:40Z
Comment #3 by github-bugzilla — 2014-07-29T19:16:47Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b16f80834e4f9fa9bd62320f132f77fb22fc65b6 fix Issue 13221 - [ICE] '0' on line 318 in file 'interpret.c' https://github.com/D-Programming-Language/dmd/commit/02c6399f67af4c80c8aef17f723879d7f0012a80 Merge pull request #3824 from 9rnsr/fix13221 [REG2.064] Issue 13221 - [ICE] '0' on line 318 in file 'interpret.c'
Comment #4 by github-bugzilla — 2014-07-31T02:35:20Z
Commit pushed to 2.066 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4c104a0f77228affd41fd0a37b5191031676a9c0 Merge pull request #3824 from 9rnsr/fix13221 [REG2.064] Issue 13221 - [ICE] '0' on line 318 in file 'interpret.c'
Comment #5 by github-bugzilla — 2014-08-22T08:05:06Z