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
Assignees
Labels
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky mdempsky commented Jan 13, 2021

@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 this to the Go1.17 milestone Jan 13, 2021
@mdempsky mdempsky self-assigned this Jan 13, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jan 13, 2021

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

Loading

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

@mdempsky mdempsky commented Jan 14, 2021

This is fixed on dev.regabi now.

Loading

@mdempsky mdempsky closed this Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants