D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20100 - Segfault with checkaction=context on struct comparison
Summary: Segfault with checkaction=context on struct comparison
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2019-08-03 15:26 UTC by moonlightsentinel
Modified: 2019-08-08 01:32 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 moonlightsentinel 2019-08-03 15:26:19 UTC
The following snippet segfaults DMD (and LDC) when using -checkaction=context:

types.d
--------------------
struct Tuple {
	bool opEquals(Tuple) { return true; }
}

void main() {
	Tuple t1;
	assert(t1 == t1);
}
--------------------

dmd -checkaction=context types.d

=> Segmentation fault (core dumped)


This snippet is a reduced test case from std.typecons (which is currently only usable without this switch)
Comment 1 Dlang Bot 2019-08-03 17:00:40 UTC
@wilzbach created dlang/dmd pull request #10270 "Fix Issue 20100 - Segfault with checkaction=context on struct comparison" fixing this issue:

- Fix Issue 20100 - Segfault with checkaction=context on struct comparison

https://github.com/dlang/dmd/pull/10270
Comment 2 Dlang Bot 2019-08-03 19:47:46 UTC
@wilzbach created dlang/dmd pull request #10271 " -checkaction=context: improve struct equals detection" fixing this issue:

- Fix Issue 20100 - Segfault with checkaction=context on struct comparison

https://github.com/dlang/dmd/pull/10271
Comment 3 Dlang Bot 2019-08-03 19:52:23 UTC
@wilzbach created dlang/druntime pull request #2720 "-checkaction=context: Improve struct output + add tests for issue 20100" mentioning this issue:

- -checkaction=context: Improve struct output + add tests for issue 20100

https://github.com/dlang/druntime/pull/2720
Comment 4 Dlang Bot 2019-08-08 01:32:24 UTC
dlang/dmd pull request #10270 "Fix Issue 20100 - Segfault with checkaction=context on struct comparison" was merged into master:

- 769cca98a012f5cbdab14fd2bc5019ae650117a0 by Sebastian Wilzbach:
  Fix Issue 20100 - Segfault with checkaction=context on struct comparison

https://github.com/dlang/dmd/pull/10270