cmd/compile: treat empty and absent struct field tags as identical

Fixes #15439.

Change-Id: I5a32384c46e20f8db6968e5a9e854c45ab262fe4
Reviewed-on: https://go-review.googlesource.com/22429
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Matthew Dempsky 2016-04-25 13:24:48 -07:00
parent 6f3f02f80d
commit e48a2958d1
11 changed files with 48 additions and 56 deletions

View file

@ -501,14 +501,11 @@ func isExportedField(ft *Field) bool {
// dnameField dumps a reflect.name for a struct field.
func dnameField(s *Sym, ot int, ft *Field) int {
var name, tag string
var name string
if ft.Sym != nil && ft.Embedded == 0 {
name = ft.Sym.Name
}
if ft.Note != nil {
tag = *ft.Note
}
nsym := dname(name, tag, nil, isExportedField(ft))
nsym := dname(name, ft.Note, nil, isExportedField(ft))
return dsymptrLSym(Linksym(s), ot, nsym, 0)
}