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

Open
mdempsky opened this issue Jul 26, 2019 · 2 comments
Open

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

mdempsky opened this issue Jul 26, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@mdempsky
Copy link
Member

@mdempsky 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 label Jul 26, 2019
@mdempsky mdempsky added this to the Unplanned milestone Jul 26, 2019
@mdempsky mdempsky self-assigned this Jul 26, 2019
@cuonglm

This comment has been minimized.

Copy link
Contributor

@cuonglm 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

This comment has been minimized.

Copy link
Member Author

@mdempsky mdempsky commented Oct 16, 2019

@cuonglm Interesting, thanks for pointing that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.