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]'.
Comment #1 by clugdbug — 2012-12-04T07:23:42Z
Comment #2 by github-bugzilla — 2012-12-04T16:21:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cb832187045782c786148db9a0bc19ace073a291 Fix issue 7890 [CTFE] - segfault for struct literal with AA field The type of the AA was set incorrectly. When expression is x[n]=y, type of the AA is x, not x[n]. https://github.com/D-Programming-Language/dmd/commit/094ea6ebfabc3c2d7dd1bda39b04e2a3f2309140 Merge pull request #1348 from donc/segfault7890ctfeAAinStruct Fix issue 7890 [CTFE] - segfault for struct literal with AA field