Commit 7732f79d authored by Russ Cox's avatar Russ Cox

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
parent 0dbd8971
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment