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
orderstmt's OSELECT case reuses t as a temporary *NodeList even though it's still live and used for the poptemp call later:
func orderstmt(n *Node, order *Order) {
...
switch n.Op {
...
case OSELECT:
t := marktemp(order)
...
case OSELRECV, OSELRECV2:
if r.Colas {
t = r.Ninit
...
poptemp(t, order)
...
}
In practice, this currently seems to work out okay because we don't allow inlining of functions with select statements, so marktemp(order) will always return nil, and the r.Colas branch will set t back to nil (or else we'll hit the Yyerror("ninit on select recv") error and fail anyway).
If I comment out OSELECT in inl.go:ishairy, then I notice this program causes marktemp(order) to return non-nil but then t is changed to nil before the poptemp(t, order) call:
package repro
func f() int
func g(int, int) int
func h(ch chan int) int {
select {
case x := <-ch:
return x
}
}
func repro() {
g(f(), h(nil))
}
The text was updated successfully, but these errors were encountered:
orderstmt's OSELECT case reuses t as a temporary *NodeList even though it's still live and used for the poptemp call later:
In practice, this currently seems to work out okay because we don't allow inlining of functions with select statements, so marktemp(order) will always return nil, and the r.Colas branch will set t back to nil (or else we'll hit the
Yyerror("ninit on select recv")
error and fail anyway).If I comment out OSELECT in inl.go:ishairy, then I notice this program causes marktemp(order) to return non-nil but then t is changed to nil before the poptemp(t, order) call:
The text was updated successfully, but these errors were encountered: