aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-10 18:19:32 -0700
committerRuss Cox <rsc@golang.org>2009-08-10 18:19:32 -0700
commit7732f79daa92fc5d5a677db397fd92910899fa29 (patch)
treeae8412eb4a49cbb8bb13d7e527481d61cee58f16 /src
parent0dbd8971a28eeefb3fb14554c0d26ccd9045490d (diff)
downloadgo-7732f79daa92fc5d5a677db397fd92910899fa29.tar.xz
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
Diffstat (limited to 'src')
-rw-r--r--src/cmd/gc/subr.c4
-rw-r--r--src/cmd/gc/typecheck.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index d4ee33d872..896f5f61d1 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -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);
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index b041cf26f9..983ff78356 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -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;