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: ICE on invalid conversion of untyped expression #33308

Closed
mdempsky opened this issue Jul 26, 2019 · 6 comments · Fixed by sthagen/golang-go#236
Closed

cmd/compile: ICE on invalid conversion of untyped expression #33308

mdempsky opened this issue Jul 26, 2019 · 6 comments · Fixed by sthagen/golang-go#236
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@mdempsky
Copy link
Member

mdempsky commented Jul 26, 2019

cmd/compile panics with an ICE on this (invalid) input:

package p

var v uint
var x = []byte((1 << v) + 1)

For comparison, go/types emits cannot convert (1 << v) + 1 (untyped int value) to []byte, while gccgo emits invalid context-determined non-integer type for left operand of shift.

Self-assigning for now since I'm working on CL 187657, which doesn't currently fix this, but I expect can easily be made to.

@mdempsky mdempsky added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 26, 2019
@mdempsky mdempsky added this to the Unplanned milestone Jul 26, 2019
@mdempsky mdempsky self-assigned this Jul 26, 2019
@cuonglm
Copy link
Member

cuonglm commented Oct 16, 2019

@mdempsky CL 187657 seems to fix this issue already, go tip now reports:

p.go:4:15: cannot convert 1 << v + 1 (type int) to type []byte

@mdempsky
Copy link
Member Author

@cuonglm Interesting, thanks for pointing that out.

@ALTree
Copy link
Member

ALTree commented Jul 20, 2020

Unless I've misunderstood the discussion above, it seems that this issue can be closed, since the crash on the reproducer is now fixed. @mdempsky is that correct?

@mdempsky
Copy link
Member Author

@ALTree I think so. A regress test would be good though.

@gopherbot
Copy link

Change https://golang.org/cl/243458 mentions this issue: cmd/compile: add test for already fixed ICE

@mdempsky
Copy link
Member Author

Oops, I thought tree was already unlocked for the next release cycle. I think a simple regress test should be fine though.

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

Successfully merging a pull request may close this issue.

4 participants