Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: failure to reject initialization loop #21752

mdempsky opened this Issue Sep 3, 2017 · 2 comments


None yet
4 participants
Copy link

commented Sep 3, 2017

cmd/compile accepts this bit of code, while go/types and gccgo reject it as an initialization cycle ("A refers to A"):

var A = func() int {
	if false {
		return A
	return 0

Related #21750. The common issue here is probably that we're performing initialization order analysis based on the optimized/inlined functions rather than the original Go source.

/cc @griesemer

@griesemer griesemer self-assigned this Sep 18, 2017

@griesemer griesemer added this to the Go1.10 milestone Sep 18, 2017


This comment has been minimized.

Copy link

commented Sep 18, 2017

Marking 1.10 so it stays on radar.

@griesemer griesemer modified the milestones: Go1.10, Go1.11 Nov 28, 2017

@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jun 30, 2018


This comment has been minimized.

Copy link

commented Oct 18, 2018

Thanks for the report @mdempsky! Commenting here to add this to my priority list or at least radar, for Go1.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.