diff options
Diffstat (limited to 'src/cmd/gc/walk.c')
-rw-r--r-- | src/cmd/gc/walk.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index c9ca9b3b3..9cd4ee919 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -501,17 +501,6 @@ walkexpr(Node **np, NodeList **init) ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); n->list = reorder1(ll); - if(isselect(n)) { - // 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); - typecheck(&b, Erv); - lr = ascompatte(n->op, 0, getoutarg(t), list1(b), 0, init); - n->list = concat(n->list, lr); - } goto ret; case OCALLMETH: @@ -602,7 +591,7 @@ walkexpr(Node **np, NodeList **init) walkexprlistsafe(n->list, init); walkexpr(&r->left, init); fn = chanfn("chanrecv2", 2, r->left->type); - r = mkcall1(fn, getoutargx(fn->type), init, r->left); + r = mkcall1(fn, getoutargx(fn->type), init, typename(r->left->type), r->left); n->rlist->n = r; n->op = OAS2FUNC; goto as2func; @@ -615,7 +604,7 @@ walkexpr(Node **np, NodeList **init) walkexprlistsafe(n->list, init); walkexpr(&r->left, init); fn = mapfn("mapaccess2", r->left->type); - r = mkcall1(fn, getoutargx(fn->type), init, r->left, r->right); + r = mkcall1(fn, getoutargx(fn->type), init, typename(r->left->type), r->left, r->right); n->rlist = list1(r); n->op = OAS2FUNC; goto as2func; @@ -628,7 +617,7 @@ walkexpr(Node **np, NodeList **init) walkexprlistsafe(n->list, init); l = n->list->n; t = l->left->type; - n = mkcall1(mapfn("mapassign2", t), T, init, l->left, l->right, n->rlist->n, n->rlist->next->n); + n = mkcall1(mapfn("mapassign2", t), T, init, typename(t), l->left, l->right, n->rlist->n, n->rlist->next->n); goto ret; case OAS2DOTTYPE: @@ -863,13 +852,13 @@ walkexpr(Node **np, NodeList **init) goto ret; t = n->left->type; - n = mkcall1(mapfn("mapaccess1", t), t->type, init, n->left, n->right); + n = mkcall1(mapfn("mapaccess1", t), t->type, init, typename(t), n->left, n->right); goto ret; case ORECV: walkexpr(&n->left, init); walkexpr(&n->right, init); - n = mkcall1(chanfn("chanrecv1", 2, n->left->type), n->type, init, n->left); + n = mkcall1(chanfn("chanrecv1", 2, n->left->type), n->type, init, typename(n->left->type), n->left); goto ret; case OSLICE: @@ -1089,7 +1078,7 @@ walkexpr(Node **np, NodeList **init) case OMAKECHAN: n = mkcall1(chanfn("makechan", 1, n->type), n->type, init, - typename(n->type->type), + typename(n->type), conv(n->left, types[TINT64])); goto ret; @@ -1101,8 +1090,7 @@ walkexpr(Node **np, NodeList **init) argtype(fn, t->type); // any-2 n = mkcall1(fn, n->type, init, - typename(t->down), // key type - typename(t->type), // value type + typename(n->type), conv(n->left, types[TINT64])); goto ret; @@ -1175,7 +1163,7 @@ walkexpr(Node **np, NodeList **init) goto ret; case OSEND: - n = mkcall1(chanfn("chansend1", 2, n->left->type), T, init, n->left, n->right); + n = mkcall1(chanfn("chansend1", 2, n->left->type), T, init, typename(n->left->type), n->left, n->right); goto ret; case OCLOSURE: @@ -1708,6 +1696,7 @@ convas(Node *n, NodeList **init) if(n->left->op == OINDEXMAP) { n = mkcall1(mapfn("mapassign1", n->left->left->type), T, init, + typename(n->left->left->type), n->left->left, n->left->right, n->right); goto out; } |