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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@mdempsky
Copy link
Member

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 NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 21, 2021
@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

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

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Jan 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

No branches or pull requests

2 participants