From: Sebastien Binet Date: Fri, 27 Feb 2015 19:42:18 +0000 (+0100) Subject: cmd/internal/gc: add missing verb to Yyerror X-Git-Tag: go1.5beta1~1825 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d24e62f2fbeded2b27684d508236be7e3e931355;p=gostls13.git cmd/internal/gc: add missing verb to Yyerror When a function had no body, Yyerror was called with an extra argument, leading to extraneous printouts. Add the missing verb to the Yyerror call and display the name of the bodiless function. Fixes #10030 Change-Id: I76d76c4547fb9cad1782cb11f7a5c63065a6e0c5 Reviewed-on: https://go-review.googlesource.com/6263 Reviewed-by: Rob Pike --- diff --git a/src/cmd/internal/gc/pgen.go b/src/cmd/internal/gc/pgen.go index cb6cb5b76f..b3045a0b0e 100644 --- a/src/cmd/internal/gc/pgen.go +++ b/src/cmd/internal/gc/pgen.go @@ -383,7 +383,7 @@ func compile(fn *Node) { var gclocals *Sym if fn.Nbody == nil { if pure_go != 0 || strings.HasPrefix(fn.Nname.Sym.Name, "init.") { - Yyerror("missing function body", fn) + Yyerror("missing function body for %q", fn.Nname.Sym.Name) goto ret }