Skip to content

cmd/compile: miscompilation of multi-assignment to named result parameters in function with defer+recover #43835

@mdempsky

Description

@mdempsky

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions