cmd/gc: fix line number for 'missing return' in closure

R=ken2
CC=golang-dev
https://golang.org/cl/7838048
This commit is contained in:
Russ Cox 2013-03-22 17:50:29 -04:00
parent 228fe9d057
commit ba0dd1f139
3 changed files with 1439 additions and 1 deletions

View file

@ -60,6 +60,7 @@ closurebody(NodeList *body)
func = curfn;
func->nbody = body;
func->endlineno = lineno;
funcbody(func);
// closure-specific variables are hanging off the
@ -154,6 +155,7 @@ makeclosure(Node *func, int nowrap)
declare(xfunc->nname, PFUNC);
xfunc->nname->funcdepth = func->funcdepth;
xfunc->funcdepth = func->funcdepth;
xfunc->endlineno = func->endlineno;
// declare variables holding addresses taken from closure
// and initialize in entry prologue.

View file

@ -168,7 +168,7 @@ Lconv(Fmt *fp)
lno = a[i].incl->line - 1; // now print out start of this file
}
if(n == 0)
fmtprint(fp, "<epoch>");
fmtprint(fp, "<unknown line number>");
return 0;
}

File diff suppressed because it is too large Load diff