]> Cypherpunks repositories - gostls13.git/commitdiff
bug 153
authorKen Thompson <ken@golang.org>
Thu, 28 May 2009 01:37:02 +0000 (18:37 -0700)
committerKen Thompson <ken@golang.org>
Thu, 28 May 2009 01:37:02 +0000 (18:37 -0700)
R=r
OCL=29479
CL=29479

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

index 96cd4005412a73727b5d367f5693a3bb024eb0a6..60d5a9d022cbfabdbbd406a45074ec328d960245 100644 (file)
@@ -1945,8 +1945,13 @@ mkdotargs(Node *r, Node *rr, Iter *saver, Node *nn, Type *l, int fp)
        st = typ(TSTRUCT);      // generated structure
        ft = T;                 // last field
        while(r != N) {
+               if(r->op == OLITERAL && r->val.ctype == CTNIL) {
+                       if(r->type == T || r->type->etype == TNIL) {
+                               yyerror("inappropriate use of nil in ... argument");
+                               return N;
+                       }
+               }
                defaultlit(r, T);
-
                if(r->type == T)        // type check failed
                        return N;
 
similarity index 100%
rename from test/bugs/bug153.go
rename to test/fixedbugs/bug153.go
index 6a7756babb46e7ca9fb6cddac8221c4c5549ae67..6bc8837d49c7569b32001e9ab5adf128d1ad70de 100644 (file)
@@ -108,10 +108,6 @@ BUG: should crash
 bugs/bug149.go:14: cannot convert []uint8 constant to string
 BUG: should compile
 
-=========== bugs/bug153.go
-BUG: errchk: bugs/bug153.go:9: error message does not match 'nil'
-bugs/bug153.go:9: fatal error: dowidth: unknown type: E-34
-
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: constant -3 overflows uint