D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18705 - dmd segmentation fault with duplicate class definition
Summary: dmd segmentation fault with duplicate class definition
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2018-04-02 08:35 UTC by Rollbein Hacknicht
Modified: 2018-11-05 12:21 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Rollbein Hacknicht 2018-04-02 08:35:05 UTC
dlang forum:
https://forum.dlang.org/post/qlmvefrlyykojtczecib@forum.dlang.org

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 RazvanN 2018-11-05 12:21:07 UTC
The code does not segfault anymore in git HEAD. Closing as fixed.