diff options
author | Russ Cox <rsc@golang.org> | 2009-11-11 22:20:05 -0800 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-11-11 22:20:05 -0800 |
commit | e5636d6e276089f840a282e3ed8ddf77188e6439 (patch) | |
tree | 21f586f407be27e97f47191e2c40a1c5cd3063d7 | |
parent | 8b957209182a49c79db0bfc2387c44b0b7fa0e2d (diff) | |
download | go-e5636d6e276089f840a282e3ed8ddf77188e6439.tar.gz go-e5636d6e276089f840a282e3ed8ddf77188e6439.zip |
avoid seg fault when return type is unknown
Fixes #80.
R=ken
https://golang.org/cl/154079
-rw-r--r-- | src/cmd/gc/subr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index 35a3a2f951..75ece477d2 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -1138,6 +1138,11 @@ Tpretty(Fmt *fp, Type *t) break; case 1: t1 = getoutargx(t)->type; + if(t1 == T) { + // failure to typecheck earlier; don't know the type + fmtprint(fp, " ?unknown-type?"); + break; + } if(t1->etype != TFIELD && t1->etype != TFUNC) { fmtprint(fp, " %T", t1); break; |