Bug 9364 – [ICE] Error: CTFE internal error painting S*

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-21T04:01:00Z
Last change time
2013-09-12T15:49:36Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2013-01-21T04:01:00Z
Not sure if actual "[ICE]" or not, but anyways, reduced test case: //---- struct S { int i; } S foo() { S s; //main.d(8) auto p = &s; p.i = 5; return s; } void main() { enum s = foo(); } //---- main.d(8): Error: CTFE internal error painting S* //---- Marking as critical because: - internal - no idea what the message means - test case is too trivial to crash
Comment #1 by yebblies — 2013-01-21T20:26:27Z
For some reason &S gets turned into paint S -> S* which, unsurprisingly, doesn't work. int foo() { static struct S { int i; } S s; (&s).i = 5; return 1; } static assert(foo());
Comment #2 by clugdbug — 2013-01-22T08:22:23Z
Yeah it's just an internal error you should never see, it's just a bit nicer than most ICE bugs because it gives the line number.
Comment #3 by github-bugzilla — 2013-09-12T15:48:37Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ff49311c47f98366aa54a97b1f797eef7875d737 Fix bug 9364 [ICE] Error: CTFE internal error painting S* SymOffExp(v) needs to create a CTFE pointer &v (instead of doing an invalid type painting operation).