]> Cypherpunks repositories - gostls13.git/commitdiff
supply default indirection to
authorKen Thompson <ken@golang.org>
Wed, 22 Apr 2009 00:00:08 +0000 (17:00 -0700)
committerKen Thompson <ken@golang.org>
Wed, 22 Apr 2009 00:00:08 +0000 (17:00 -0700)
map indexing - bug 143

R=r
OCL=27695
CL=27695

src/cmd/gc/walk.c

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