1
0
mirror of https://github.com/golang/go synced 2024-11-20 11:04:56 -07:00

fix indirect error

x.go:3: invalid indirect of X (type int)

was
x.go:3: invalid indirect of nil

R=ken
OCL=33008
CL=33008
This commit is contained in:
Russ Cox 2009-08-10 18:19:32 -07:00
parent 0dbd8971a2
commit 7732f79daa
2 changed files with 4 additions and 2 deletions

View 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);

View 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;