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

mdempsky opened this issue Jan 13, 2021 · 2 comments


Copy link

@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
Copy link

@gopherbot gopherbot commented Jan 13, 2021

Change 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
Trust: Matthew Dempsky <>
Run-TryBot: Matthew Dempsky <>
TryBot-Result: Go Bot <>
Reviewed-by: Than McIntosh <>
Copy link
Member Author

@mdempsky mdempsky commented Jan 14, 2021

This is fixed on dev.regabi now.


@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
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants