Bug 7890 – [CTFE] - segfault for struct literal with AA field
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-11T08:27:00Z
Last change time
2015-06-09T05:11:59Z
Keywords
CTFE, ice, pull
Assigned to
nobody
Creator
code
Comments
Comment #0 by code — 2012-04-11T08:27:29Z
cat > bug.d << CODE
struct Foo
{
int[int] tab;
}
Foo ctfe()
{
Foo foo;
foo.tab[0] = 0;
return foo;
}
enum f = ctfe();
CODE
dmd -c bug
--------
The segfault happens during the hasNonConstPointers check
for the enum initializer. At that point the tab field type
is 'int' instead of 'int[int]'.