Commit d24e62f2 authored by Sebastien Binet's avatar Sebastien Binet Committed by Rob Pike

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/6263Reviewed-by: default avatarRob Pike <r@golang.org>
parent 90dbd428
......@@ -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
}
......
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