]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/gc: add missing verb to Yyerror
authorSebastien Binet <seb.binet@gmail.com>
Fri, 27 Feb 2015 19:42:18 +0000 (20:42 +0100)
committerRob Pike <r@golang.org>
Fri, 27 Feb 2015 20:07:53 +0000 (20:07 +0000)
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 <r@golang.org>
src/cmd/internal/gc/pgen.go

index cb6cb5b76f106ed8560d200ad673246c0002ba2c..b3045a0b0e769db79eff448b348593dea72fb239 100644 (file)
@@ -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
                }