Commit ba0dd1f1 authored by Russ Cox's avatar Russ Cox

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

R=ken2
CC=golang-dev
https://golang.org/cl/7838048
parent 228fe9d0
...@@ -60,6 +60,7 @@ closurebody(NodeList *body) ...@@ -60,6 +60,7 @@ closurebody(NodeList *body)
func = curfn; func = curfn;
func->nbody = body; func->nbody = body;
func->endlineno = lineno;
funcbody(func); funcbody(func);
// closure-specific variables are hanging off the // closure-specific variables are hanging off the
...@@ -154,6 +155,7 @@ makeclosure(Node *func, int nowrap) ...@@ -154,6 +155,7 @@ makeclosure(Node *func, int nowrap)
declare(xfunc->nname, PFUNC); declare(xfunc->nname, PFUNC);
xfunc->nname->funcdepth = func->funcdepth; xfunc->nname->funcdepth = func->funcdepth;
xfunc->funcdepth = func->funcdepth; xfunc->funcdepth = func->funcdepth;
xfunc->endlineno = func->endlineno;
// declare variables holding addresses taken from closure // declare variables holding addresses taken from closure
// and initialize in entry prologue. // and initialize in entry prologue.
......
...@@ -168,7 +168,7 @@ Lconv(Fmt *fp) ...@@ -168,7 +168,7 @@ Lconv(Fmt *fp)
lno = a[i].incl->line - 1; // now print out start of this file lno = a[i].incl->line - 1; // now print out start of this file
} }
if(n == 0) if(n == 0)
fmtprint(fp, "<epoch>"); fmtprint(fp, "<unknown line number>");
return 0; return 0;
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment