1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:54:43 -07:00

gc: handle _ = <-c in select.

Fixes #238.

R=ken2
https://golang.org/cl/163098
This commit is contained in:
Russ Cox 2009-12-03 01:30:19 -08:00
parent 05a1eb1ab0
commit c6e316a4b9
4 changed files with 23 additions and 5 deletions

View File

@ -118,7 +118,7 @@ walkselect(Node *sel)
else { else {
// introduce temporary until we're sure this will succeed. // introduce temporary until we're sure this will succeed.
tmp = nod(OXXX, N, N); tmp = nod(OXXX, N, N);
tempname(tmp, n->left->type); tempname(tmp, n->right->type->type);
a = nod(OADDR, tmp, N); a = nod(OADDR, tmp, N);
} }
// selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool); // selectrecv(sel *byte, hchan *chan any, elem *any) (selected bool);

22
test/fixedbugs/bug225.go Normal file
View File

@ -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");
}
}

View File

@ -142,10 +142,6 @@ panic PC=xxx
== bugs/ == bugs/
=========== bugs/bug218.go
<epoch>: fatal error: dowidth: unknown type: blank
BUG: bug218
=========== bugs/bug219.go =========== bugs/bug219.go
bugs/bug219.go:16: syntax error near if bugs/bug219.go:16: syntax error near if
BUG: bug219 BUG: bug219