Skip to content

Commit

Permalink
avoid seg fault when return type is unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Nov 12, 2009
1 parent 8b95720 commit e5636d6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/gc/subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e5636d6

Please sign in to comment.