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: inlined initializer of blank variable fails on dev.regabi branch #43677

Closed
mdempsky opened this issue Jan 13, 2021 · 2 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

@thanm reports that the dev.regabi compiler fails to build k8s after ffb0cb7 (CL 278914). Minimized test case is:

package p

func foo() *int { return nil }

var _ interface{} = foo()
@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 13, 2021
@mdempsky mdempsky added this to the Go1.17 milestone Jan 13, 2021
@mdempsky mdempsky self-assigned this Jan 13, 2021
@gopherbot
Copy link

Change https://golang.org/cl/283537 mentions this issue: [dev.regabi] cmd/compile: fix ICE when initializing blank vars

gopherbot pushed a commit that referenced this issue Jan 14, 2021
CL 278914 introduced NameOffsetExpr to avoid copying ONAME nodes and
hacking up their offsets, but evidently staticinit subtly depended on
the prior behavior to allow dynamic initialization of blank variables.

This CL refactors the code somewhat to avoid using NameOffsetExpr with
blank variables, and to instead create dynamic assignments directly to
the global blank node. It also adds a check to NewNameOffsetExpr to
guard against misuse like this, since I suspect there could be other
cases still lurking within staticinit. (This code is overdue for an
makeover anyway.)

Thanks to thanm@ for bisect and test case minimization.

Fixes #43677.

Change-Id: Ic71cb5d6698382feb9548dc3bb9fd606b207a172
Reviewed-on: https://go-review.googlesource.com/c/go/+/283537
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
@mdempsky
Copy link
Member Author

This is fixed on dev.regabi now.

@golang golang locked and limited conversation to collaborators Jan 14, 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.
Projects
None yet
Development

No branches or pull requests

2 participants