mirror of
https://github.com/golang/go
synced 2024-10-02 22:25:08 +00:00
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:
parent
228fe9d057
commit
ba0dd1f139
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
1436
test/return.go
1436
test/return.go
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue