D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9327 - alias this declaration and unknown identifiers lead to segmentation fault
Summary: alias this declaration and unknown identifiers lead to segmentation fault
Status: RESOLVED DUPLICATE of issue 17380
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: ice
Depends on:
Blocks:
 
Reported: 2013-01-16 11:04 UTC by tvwhite51
Modified: 2018-10-10 23:00 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 tvwhite51 2013-01-16 11:04:18 UTC
If two classes alias this each other and their is an unknown identifier DMD will fail with segmentation fault: 11. This is on DMD 2.061, Mac OS X 10.8.2.

Example:

class foo {
	bar fun;
	alias fun this;

	this() {
		fun = new bar(this);
		fun.a = 5; //remove this line and the program will compile.
	}
}

class bar {
	foo sun;
	alias sun this;

	this(foo t) {
		sun = t;
	}
}

void main() {
	foo fun = new foo;
}
Comment 1 yebblies 2013-11-23 04:54:49 UTC
Specifically, a stack overflow
Comment 2 Iain Buclaw 2018-10-10 23:00:58 UTC
Fixed by https://github.com/dlang/dmd/pull/6969

*** This issue has been marked as a duplicate of issue 17380 ***