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

mdempsky opened this issue Jan 21, 2021 · 2 comments


Copy link

@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() {

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

/cc @cuonglm

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

@mdempsky mdempsky commented Jan 21, 2021

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


Copy link

@gopherbot gopherbot commented Jan 22, 2021

Change mentions this issue: cmd/compile: fix order-of-assignment issue w/ defers


@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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants