← Back to index
|
Original Bugzilla link
Bug 7043 – CTFE: ICE illegal reference value 0LU, only with -inline
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-12-01T07:48:00Z
Last change time
2015-06-09T05:11:35Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
hoganmeier
Attachments
ID
Filename
Summary
Content-Type
Size
1048
treemapgen.d
withoutstd
application/octet-stream
1618
Comments
Comment #0
by hoganmeier — 2011-12-01T07:48:01Z
import std.conv; string demangleZSymbols(string sym) { char[] res; try auto len = parse!uint(sym); catch (Exception e) sym = null; return cast(immutable) res; } pragma(msg, demangleZSymbols("8serenity9persister6Sqlite7__arrayZ")); $ dmd -c -release -O -inline treemapgen.d std/array.d(467): Error: CTFE internal error: illegal reference value 0LU dmd: interpret.c:6244: void VarDeclaration::createRefValue(Expression*): Assertion `IsRefValueValid(newval)' failed.
Comment #1
by hoganmeier — 2011-12-01T07:50:38Z
Created attachment 1048 withoutstd Here's a reduced version not importing phobos. Don't know if that helps.
Comment #2
by clugdbug — 2011-12-02T02:41:53Z
Reduced test case, requires -inline: bool decode(S)(ref int x) { return true; } bool front(A)() { int i = 0; return decode!(char)(i); } static assert( is(typeof({ front!(int)(); }())) ); static assert ( front!(int)());
Comment #3
by clugdbug — 2011-12-02T02:52:02Z
Further reduced. Still requires -inline. bool bug7043(S)(ref int x) { return true; } static assert( { int i = 0; return bug7043!(char)(i); }() );
Comment #4
by bugzilla — 2011-12-18T21:57:10Z
https://github.com/D-Programming-Language/dmd/commit/d0e793e0e62d3d11ab9c622e934388d16af51c3b
https://github.com/D-Programming-Language/dmd/commit/325e94c9354fd5d3e21a1976df83b78a2d3a1a41