Skip to content

cmd/compile: f.NamedValue entry for reg param causes register allocator miscompile #46304

@thanm

Description

@thanm

What version of Go are you using (go version)?

$ go version
go version devel go1.17-831573cd21 Fri May 21 03:21:56 2021 +0000 linux/amd64

Does this issue reproduce with the latest release?

This is a problem on tip, not in previous releases.

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Run this program:

https://play.golang.org/p/spT4IJFC6_n

What did you expect to see?

Program should print "anew" and terminate.

What did you see instead?

panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.(*M).walkOp(0xc0000f0e08, 0xc0000f4000)
/tmp/repro.go:50 +0x29c
main.main()
/tmp/repro.go:63 +0x145
exit status 2

Bisection identifies this commit as the problem:

https://go.googlesource.com/go/+/f62739b8611a0f1c96e59eb6574422562bb46233

which corresponds to the CL https://go-review.googlesource.com/c/go/+/316890.

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