diff --git a/src/cmd/gc/order.c b/src/cmd/gc/order.c index 1311c6e5e2d..b9f2d35ce4d 100644 --- a/src/cmd/gc/order.c +++ b/src/cmd/gc/order.c @@ -1053,6 +1053,7 @@ orderexpr(Node **np, Order *order) break; case ORECV: + orderexpr(&n->left, order); n = ordercopyexpr(n, n->type, order, 1); break; } diff --git a/test/fixedbugs/issue8011.go b/test/fixedbugs/issue8011.go new file mode 100644 index 00000000000..b966174c05d --- /dev/null +++ b/test/fixedbugs/issue8011.go @@ -0,0 +1,18 @@ +// run + +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + c := make(chan chan int, 1) + c1 := make(chan int, 1) + c1 <- 42 + c <- c1 + x := <-<-c + if x != 42 { + println("BUG:", x, "!= 42") + } +}