You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issues exists in current master (go1.18-devel), but has probably existed for a while.
When an OAS node is converted to an OSELRECV2 node in tcSelect(), any DCL node in the Init field (due to a := assignment) is being dropped, since a completely new node is being created and the Init field was not set.
package main
func main() {
ch := make(chan int, 1)
var ptrs [2]*int
for i := range ptrs {
ch <- i
select {
case x := <-ch:
ptrs[i] = &x
}
}
for i, ptr := range ptrs {
if *ptr != i {
println("FAIL:", *ptr, "!=", i)
}
}
}
The text was updated successfully, but these errors were encountered:
The problem this fixes was introduced by 0328c3b. It affects the Go 1.17 series, including go1.17.3.
$ ./bin/go version && ./bin/go run ~/issue48289.go
go version go1.16.10 linux/amd64
$ ./bin/go version && ./bin/go run ~/issue48289.go
go version go1.17.3 linux/amd64
FAIL: 1 != 0
$ ./bin/go version && ./bin/go run ~/issue48289.go
go version devel +88e1415d08 Thu Dec 17 04:43:59 2020 +0000 linux/amd64
$ ./bin/go version && ./bin/go run ~/issue48289.go
go version devel +0328c3b660 Thu Dec 17 15:50:38 2020 +0000 linux/amd64
FAIL: 1 != 0
@gopherbot please consider this for backport to 1.17
Issues exists in current master (go1.18-devel), but has probably existed for a while.
When an OAS node is converted to an OSELRECV2 node in tcSelect(), any DCL node in the Init field (due to a := assignment) is being dropped, since a completely new node is being created and the Init field was not set.
Thanks for the test case created by @mdempsky:
The text was updated successfully, but these errors were encountered: