]> Cypherpunks repositories - gostls13.git/commitdiff
fix indirect error
authorRuss Cox <rsc@golang.org>
Tue, 11 Aug 2009 01:19:32 +0000 (18:19 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 11 Aug 2009 01:19:32 +0000 (18:19 -0700)
x.go:3: invalid indirect of X (type int)

was
x.go:3: invalid indirect of nil

R=ken
OCL=33008
CL=33008

src/cmd/gc/subr.c
src/cmd/gc/typecheck.c

index d4ee33d872667ae5a142f32dddf1a86bd86763f8..896f5f61d12c0cfb48e2c04801dd5835e3e50020 100644 (file)
@@ -1215,7 +1215,9 @@ Nconv(Fmt *fp)
        }
 
        if(fp->flags & FmtSign) {
-               if(n->type == T || n->type->etype == TNIL)
+               if(n->type == T)
+                       fmtprint(fp, "%#N", n);
+               else if(n->type->etype == TNIL)
                        fmtprint(fp, "nil");
                else
                        fmtprint(fp, "%#N (type %T)", n, n->type);
index b041cf26f9ed9a67085f766651e5aad8767e1c27..983ff78356a7e011902d92fb5ee04a0e1ae73823 100644 (file)
@@ -221,7 +221,7 @@ reswitch:
                        goto ret;
                }
                if(!isptr[t->etype]) {
-                       yyerror("invalid indirect of %+N", n);
+                       yyerror("invalid indirect of %+N", n->left);
                        goto error;
                }
                ok |= Erv;