-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/ssa: slice to array conversion has the wrong type #57790
Labels
Milestone
Comments
Change https://go.dev/cl/462175 mentions this issue: |
Change https://go.dev/cl/462050 mentions this issue: |
gopherbot
pushed a commit
to golang/tools
that referenced
this issue
Jan 17, 2023
Adds a sanity check that the types of phi edges are types.Identical to the Phi instruction. This would have caught golang/go#57790. Change-Id: I9818fc47fda368bfc009bfe4de66e23de759f6ca Reviewed-on: https://go-review.googlesource.com/c/tools/+/462050 gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Tim King <taking@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
aykevl
added a commit
to tinygo-org/tinygo
that referenced
this issue
Feb 6, 2023
For the bugfix, see: golang/go#57790
deadprogram
pushed a commit
to tinygo-org/tinygo
that referenced
this issue
Feb 7, 2023
For the bugfix, see: golang/go#57790
waj334
pushed a commit
to waj334/tinygo
that referenced
this issue
Feb 7, 2023
For the bugfix, see: golang/go#57790
deadprogram
pushed a commit
to tinygo-org/tinygo
that referenced
this issue
Feb 14, 2023
For the bugfix, see: golang/go#57790
waj334
pushed a commit
to waj334/tinygo
that referenced
this issue
Feb 19, 2023
For the bugfix, see: golang/go#57790
waj334
pushed a commit
to waj334/tinygo
that referenced
this issue
Feb 24, 2023
For the bugfix, see: golang/go#57790
LiuJiazheng
pushed a commit
to LiuJiazheng/tinygo
that referenced
this issue
Aug 20, 2023
For the bugfix, see: golang/go#57790
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
What version of Go are you using (
go version
)?And I'm using the latest version of x/tools/go/ssa: 03eac81
Does this issue reproduce with the latest release?
No, slice to array conversions were added in Go 1.20.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I created a simple Go file with the following contents:
Then I dumped the SSA output using
ssadump
:The problem here is that
t3
has the wrong type. It should be*[4]int
(a pointer) but instead it is[4]int
(an array). This triggers an issue on the following line:Here,
t3
(which should be of pointer type but is an array here) is dereferenced. This leads to a panic in my code, which expects to dereference a pointer and not an array.The text was updated successfully, but these errors were encountered: