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: miscompilation of multi-assignment to named result parameters in function with defer+recover #43835

Closed
mdempsky opened this issue Jan 21, 2021 · 2 comments
Assignees
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jan 21, 2021

This program used to run correctly with Go 1.15, but fails with Go 1.16 beta 1:

package main

func main() {
	if f() {
		panic("FAIL")
	}
}

func f() (bad bool) {
	defer func() {
		recover()
	}()
	var p *int
	bad, _ = true, *p
	return
}

/cc @cuonglm

@mdempsky mdempsky added this to the Go1.16 milestone Jan 21, 2021
@mdempsky mdempsky self-assigned this Jan 21, 2021
@mdempsky
Copy link
Member Author

@mdempsky mdempsky commented Jan 21, 2021

Bisection identifes CL 261677 (85bb429), which I figured was probably the culprit.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Jan 22, 2021

Change https://golang.org/cl/285633 mentions this issue: cmd/compile: fix order-of-assignment issue w/ defers

Loading

@gopherbot gopherbot closed this in deaf29a Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants