← Back to index
|
Original Bugzilla link
Bug 6894 – ICE(cod1.c) with immutable and static
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-05T04:06:00Z
Last change time
2013-06-20T08:12:23Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2011-11-05T04:06:51Z
int foo(int[1]) { return 1; } void main() { immutable int[1] array = [0]; static int perms = foo(array); } DMD 2.057head gives: Internal error: backend\cod1.c 1737
Comment #1
by yebblies — 2011-12-12T21:46:34Z
With the current version of 2.057, you get this: assert interpret.c(100) v->ctfeAdrOnStack >= 0 && v->ctfeAdrOnStack < stackPointer()
Comment #2
by bearophile_hugs — 2012-10-19T14:02:41Z
With dmd 2.061alpha it gives: Internal error: backend\cod1.c 1718 - - - - - - - - - Maybe related: bool foo(int[3] data) { return true; } struct Bar(T...) if (foo(T[0])) {} void main() { immutable int[3] array = [1, 2, 3]; Bar!array b; }
Comment #3
by clugdbug — 2013-06-20T08:12:23Z
Now works in git HEAD