Bug 18705 – dmd segmentation fault with duplicate class definition

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-04-02T08:35:05Z
Last change time
2018-11-05T12:21:07Z
Keywords
ice
Assigned to
No Owner
Creator
Rollbein Hacknicht

Comments

Comment #0 by test1 — 2018-04-02T08:35:05Z
dlang forum: https://forum.dlang.org/post/[email protected] snippet https://run.dlang.io/is/OySBGO the provoking line is commented out in that snippet. when commented in, all compilers give the segfault, including ldc ones. except for 'all dmd compilers..' with version <= 2.066.0 post by LiNbO3 might give more details > > There are a couple of bugs here: > > --- > void main() > { > { class C { } } > class C { } > // C x; x.x=1; > // static assert (!__traits(compiles, C.x)); > } > --- > > The first bug can be shown by de-commenting the first line and can be easily solved by modifying hdrgen.d by adding a check on t.sym.parent being non-null to the visit(TypeClass) method. > Once that's fixed de-comment the second line to have the compiler crash and burn somewhere else.
Comment #1 by razvan.nitu1305 — 2018-11-05T12:21:07Z
The code does not segfault anymore in git HEAD. Closing as fixed.