D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19187 - __traits(compiles) segfaults on access to partially undefined overload set from import
Summary: __traits(compiles) segfaults on access to partially undefined overload set fr...
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:
Depends on:
Blocks:
 
Reported: 2018-08-24 16:31 UTC by FeepingCreature
Modified: 2018-08-30 06:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description FeepingCreature 2018-08-24 16:31:09 UTC
Repro:

$ cat test1.d
import test2;

enum test = __traits(compiles, test2.foo);
$ cat test2.d
template test() { }
alias foo = test;
alias foo = NONEXISTENT;
$ dmd test1.d
Segmentation fault (core dumped)
$
Comment 1 FeepingCreature 2018-08-24 16:40:37 UTC
https://github.com/dlang/dmd/pull/8613 pr up
Comment 2 github-bugzilla 2018-08-30 06:24:39 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b69d67407ecbac890ddf706f5b8fe65adece61a3
Fix Issue 19187: check variable type is defined before accessing

https://github.com/dlang/dmd/commit/6e53e55ad35a12e48674a4844d0995e8ec7f9097
Merge pull request #8613 from FeepingCreature/fix/Issue-19187

Fix Issue 19187: check variable type is defined before accessing
merged-on-behalf-of: Jacob Carlborg <jacob-carlborg@users.noreply.github.com>