mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: check for missing function body earlier
Tested by fixedbugs/issue3705.go. This removes a dependency on lineno from near the backend. Change-Id: I228bd0ad7295cf881b9bdeb0df9d18483fb96821 Reviewed-on: https://go-review.googlesource.com/38382 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
49a533e212
commit
0dafb7d962
2 changed files with 4 additions and 6 deletions
|
|
@ -12,7 +12,6 @@ import (
|
|||
"cmd/internal/sys"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// "Portable" code generation.
|
||||
|
|
@ -278,11 +277,6 @@ func compile(fn *Node) {
|
|||
dowidth(fn.Type)
|
||||
|
||||
if fn.Nbody.Len() == 0 {
|
||||
if pure_go || strings.HasPrefix(fn.Func.Nname.Sym.Name, "init.") {
|
||||
yyerror("missing function body for %q", fn.Func.Nname.Sym.Name)
|
||||
return
|
||||
}
|
||||
|
||||
emitptrargsmap()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue