]> Cypherpunks repositories - gostls13.git/commitdiff
explain selectsend problem
authorRuss Cox <rsc@golang.org>
Mon, 20 Jul 2009 20:29:56 +0000 (13:29 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 20 Jul 2009 20:29:56 +0000 (13:29 -0700)
R=ken
OCL=31865
CL=31867

src/cmd/gc/walk.c

index 65c4f7efd65fe4001eefa2ae12f69497d6881b58..be3f0b9cb72652e5fa243aa4f8ee11320f54b2bf 100644 (file)
@@ -606,7 +606,10 @@ reswitch:
                        ll = ascompatte(n->op, getinarg(t), n->list, 0, init);
                        n->list = reorder1(ll);
                        if(isselect(n)) {
-                               // clear output bool - special prob with selectsend
+                               // special prob with selectsend and selectrecv:
+                               // if chan is nil, they don't know big the channel
+                               // element is and therefore don't know how to find
+                               // the output bool, so we clear it before the call.
                                Node *b;
                                b = nodbool(0);
                                lr = ascompatte(n->op, getoutarg(t), list1(b), 0, init);