-
Notifications
You must be signed in to change notification settings - Fork 18.1k
cmd/compile: internal compiler error: panic: interface conversion: ir.Node is *ir.CompLitExpr, not *ir.Name #58325
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
Comments
Another issue with inline static init, |
Change https://go.dev/cl/465098 mentions this issue: |
@gopherbot please consider backport this to 1.20, it's a regression. |
Backport issue(s) opened: #58335 (for 1.20). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Blank node must be ignored when building arguments substitued tree. Otherwise, it could be used to replace other blank node in left hand side of an assignment, causing an invalid IR node. Consider the following code: type S1 struct { s2 S2 } type S2 struct{} func (S2) Make() S2 { return S2{} } func (S1) Make() S1 { return S1{s2: S2{}.Make()} } var _ = S1{}.Make() After staticAssignInlinedCall, the assignment becomes: var _ = S1{s2: S2{}.Make()} and the arg substitued tree is "map[*ir.Name]ir.Node{_: S1{}}". Now, when doing static assignment, if there is any assignment to blank node, for example: _ := S2{} That blank node will be replaced with "S1{}": S1{} := S2{} So constructing an invalid IR which causes the ICE. Fixes golang#58325 Change-Id: I21b48357f669a7e02a7eb4325246aadc31f78fb9 Reviewed-on: https://go-review.googlesource.com/c/go/+/465098 Run-TryBot: Cuong Manh Le <[email protected]> Auto-Submit: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: David Chase <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Attempt to run the following program with Go 1.20
(this is a silly example, but it was extracted and minimized from a much larger program while trying to get Go 1.20 running)
What did you expect to see?
The binary runs successfully and does nothing.
What did you see instead?
The text was updated successfully, but these errors were encountered: