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
The program below should run and terminate successfully. It does so when compiled with gccgo, but it fatal errors due to deadlock when compiled with cmd/compile.
package main
var ch = make(chan int)
func f() chan int {
close(ch)
ch = nil
return nil
}
func main() {
select {
case <-ch:
case f() <- 0:
}
}
The issue is this code responsible for ordering receive clauses within select statements:
The program below should run and terminate successfully. It does so when compiled with gccgo, but it fatal errors due to deadlock when compiled with cmd/compile.
The issue is this code responsible for ordering receive clauses within select statements:
go/src/cmd/compile/internal/gc/order.go
Lines 892 to 896 in 6c64b6d
It should actually be checking IsAutoTmp like the code responsible for ordering send clauses:
go/src/cmd/compile/internal/gc/order.go
Lines 951 to 959 in 6c64b6d
Discovered with @cuonglm.
The text was updated successfully, but these errors were encountered: