7043 – CTFE: ICE illegal reference value 0LU, only with -inline

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7043 - CTFE: ICE illegal reference value 0LU, only with -inline
Summary: CTFE: ICE illegal reference value 0LU, only with -inline
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
Reported: 2011年12月01日 07:48 UTC by Trass3r
Modified: 2015年06月09日 05:11 UTC (History)
2 users (show)

See Also:


Attachments
withoutstd (1.58 KB, application/octet-stream)
2011年12月01日 07:50 UTC, Trass3r
Details
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Trass3r 2011年12月01日 07:48:01 UTC
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 Trass3r 2011年12月01日 07:50:38 UTC
Created attachment 1048 [details] 
withoutstd
Here's a reduced version not importing phobos. Don't know if that helps.
Comment 2 Don 2011年12月02日 02:41:53 UTC
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 Don 2011年12月02日 02:52:02 UTC
Further reduced. Still requires -inline.
bool bug7043(S)(ref int x) {
 return true;
}
static assert( { 
 int i = 0;
 return bug7043!(char)(i);
}() );


AltStyle によって変換されたページ (->オリジナル) /