]> Cypherpunks repositories - gostls13.git/commitdiff
2 minor bugs.
authorKen Thompson <ken@golang.org>
Wed, 22 Apr 2009 02:52:13 +0000 (19:52 -0700)
committerKen Thompson <ken@golang.org>
Wed, 22 Apr 2009 02:52:13 +0000 (19:52 -0700)
lv context for some [] operations
calling implicit(*map) before walk.

R=r
OCL=27706
CL=27706

src/cmd/gc/walk.c

index c1ac526d5a40c656e5bf12b44736dfda8a7e6823..798978b9a43a190064016b9fe07af5bdaa760d1d 100644 (file)
@@ -465,8 +465,8 @@ loop:
                case OINDEX:
                        if(cl == 2 && cr == 1) {
                                // a,b = map[] - mapaccess2
-                               implicitstar(&r->left);
                                walktype(r->left, Erv);
+                               implicitstar(&r->left);
                                if(!istype(r->left->type, TMAP))
                                        break;
                                l = mapop(n, top);
@@ -3228,8 +3228,8 @@ multi:
                // if so, types are valuetype,bool
                if(cl != 2)
                        goto badt;
+               walktype(nr->left, Erv);
                implicitstar(&nr->left);
-               walktype(nr->left, Elv);
                t = nr->left->type;
                if(!istype(t, TMAP))
                        goto badt;