]> Cypherpunks repositories - gostls13.git/commitdiff
bug086
authorKen Thompson <ken@golang.org>
Wed, 11 Mar 2009 02:16:31 +0000 (19:16 -0700)
committerKen Thompson <ken@golang.org>
Wed, 11 Mar 2009 02:16:31 +0000 (19:16 -0700)
R=r
OCL=26090
CL=26090

src/cmd/gc/walk.c
test/fixedbugs/bug087.go [moved from test/bugs/bug087.go with 100% similarity]
test/golden.out

index d82dfd4ebf09065ac1ecebb91a776de277ad7fcc..6c93c11cfe1a68f9cb13658e58f631592c27a0bf 100644 (file)
@@ -733,7 +733,6 @@ loop:
                        goto nottop;
                walktype(n->left, Erv);
                implicitstar(&n->left);
-               evconst(n);
                t = n->left->type;
                if(t == T)
                        goto ret;
@@ -741,6 +740,9 @@ loop:
                default:
                        goto badt;
                case TSTRING:
+                       if(whatis(n->left) == Wlitstr)
+                               nodconst(n, types[TINT], n->left->val.u.sval->len);
+                       break;
                case TMAP:
                        break;
                case TARRAY:
similarity index 100%
rename from test/bugs/bug087.go
rename to test/fixedbugs/bug087.go
index 31616f4faa46bb3604606bb712278e54f691cb30..5dfe1953aaca5819582b92abb4a060b2e2333579 100644 (file)
@@ -115,11 +115,6 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
 =========== chan/nonblock.go
 PASS
 
-=========== bugs/bug087.go
-bugs/bug087.go:8: illegal combination of literals LEN 9
-bugs/bug087.go:8: illegal combination of literals LEN 9
-BUG: fails incorrectly
-
 =========== bugs/bug108.go
 bugs/bug108.go:4: stupid shift: 1025
 BUG: errchk: command succeeded unexpectedly:  6g bugs/bug108.go