Bug 17152 – DMD segfaults because of struct with static const struct members
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2017-02-07T17:27:03Z
Last change time
2020-03-21T03:56:42Z
Keywords
ice
Assigned to
No Owner
Creator
Sophie
Comments
Comment #0 by meapineapple — 2017-02-07T17:27:03Z
DMD 2.072.0 crashes when compiling this program:
struct Test{
static const A = Test([1, 2, 3]);
static const B = Test([4, 5, 6]);
int[] x;
}
void main(){}
> dmd test.d
Segmentation fault: 11
Changing from const to immutable does not affect the error.
It works fine if one of the static const members are removed. It works fine if the members are static enum instead of static const.
Comment #1 by meapineapple — 2017-02-07T18:39:29Z
Apparently this issue is fixed in master, will close the issue as soon as I'm able to confirm
Comment #2 by b2.temp — 2019-11-05T22:06:00Z
all platforms were affected, confirmed to be fixed using run.dalng.io:
Up to 2.071.2: Success and no output
2.072.2 to 2.073.2: Segfault and no output
Since 2.074.1: Success and no output