1
0
mirror of https://github.com/golang/go synced 2024-11-11 22:40:22 -07:00

cmd/compile: reintroduce support for version 0 export format

The Go1.7 export format didn't encode the field package for
blank struct fields (#15514). Re-introduce support for that
format so we can read it w/o error.

For #16881.

Change-Id: Ib131d41aac56dbf970aab15ae7e75ef3944b412d
Reviewed-on: https://go-review.googlesource.com/27912
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-08-26 13:06:59 -07:00
parent fba8f4deba
commit c85b77c22b

View File

@ -623,6 +623,11 @@ func (p *importer) method() *Node {
// parser.go:sym,hidden_importsym
func (p *importer) fieldName() *Sym {
name := p.string()
if p.version == 0 && name == "_" {
// version 0 didn't export a package for _ fields
// but used the builtin package instead
return builtinpkg.Lookup(name)
}
pkg := localpkg
if name != "" && !exportname(name) {
if name == "?" {