diff --git a/src/cmd/gc/select.c b/src/cmd/gc/select.c index 3f28b1c563d..9cba01fa51e 100644 --- a/src/cmd/gc/select.c +++ b/src/cmd/gc/select.c @@ -118,7 +118,7 @@ walkselect(Node *sel) else { // introduce temporary until we're sure this will succeed. tmp = nod(OXXX, N, N); - tempname(tmp, n->left->type); + tempname(tmp, n->right->type->type); a = nod(OADDR, tmp, N); } // selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); diff --git a/test/bugs/bug218.go b/test/fixedbugs/bug218.go similarity index 100% rename from test/bugs/bug218.go rename to test/fixedbugs/bug218.go diff --git a/test/fixedbugs/bug225.go b/test/fixedbugs/bug225.go new file mode 100644 index 00000000000..8acf66c4e47 --- /dev/null +++ b/test/fixedbugs/bug225.go @@ -0,0 +1,22 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// Copyright 2009 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 bool, 1); + select { + case _ = <-c: + panic("BUG: recv should not"); + default: + } + c <- true; + select { + case _ = <-c: + default: + panic("BUG: recv should"); + } +} diff --git a/test/golden.out b/test/golden.out index 64bfd6ecc7b..9813c8313dc 100644 --- a/test/golden.out +++ b/test/golden.out @@ -142,10 +142,6 @@ panic PC=xxx == bugs/ -=========== bugs/bug218.go -: fatal error: dowidth: unknown type: blank -BUG: bug218 - =========== bugs/bug219.go bugs/bug219.go:16: syntax error near if BUG: bug219