mirror of https://github.com/golang/go.git
cmd/link, internal/abi: minor follow-up cleanups
these address comments on CLs in the large refactoring stack recently submitted. Change-Id: Ic9023c32aafe4dda953b42c9a36834d3ab3432eb Reviewed-on: https://go-review.googlesource.com/c/go/+/495835 Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
93477f0770
commit
8c822ac7e8
|
|
@ -59,7 +59,7 @@ func decodetypePtrdata(arch *sys.Arch, p []byte) int64 {
|
|||
|
||||
// Type.commonType.tflag
|
||||
func decodetypeHasUncommon(arch *sys.Arch, p []byte) bool {
|
||||
return abi.TFlag(p[2*arch.PtrSize+4])&abi.TFlagUncommon != 0
|
||||
return abi.TFlag(p[abi.TFlagOff(arch.PtrSize)])&abi.TFlagUncommon != 0
|
||||
}
|
||||
|
||||
// Type.FuncType.dotdotdot
|
||||
|
|
@ -222,7 +222,7 @@ func decodetypeStr(ldr *loader.Loader, arch *sys.Arch, symIdx loader.Sym) string
|
|||
relocs := ldr.Relocs(symIdx)
|
||||
str := decodetypeName(ldr, symIdx, &relocs, 4*arch.PtrSize+8)
|
||||
data := ldr.Data(symIdx)
|
||||
if data[2*arch.PtrSize+4]&byte(abi.TFlagExtraStar) != 0 {
|
||||
if data[abi.TFlagOff(arch.PtrSize)]&byte(abi.TFlagExtraStar) != 0 {
|
||||
return str[1:]
|
||||
}
|
||||
return str
|
||||
|
|
|
|||
|
|
@ -675,10 +675,10 @@ func (n Name) Tag() string {
|
|||
|
||||
func NewName(n, tag string, exported, embedded bool) Name {
|
||||
if len(n) >= 1<<29 {
|
||||
panic("reflect.nameFrom: name too long: " + n[:1024] + "...")
|
||||
panic("abi.NewName: name too long: " + n[:1024] + "...")
|
||||
}
|
||||
if len(tag) >= 1<<29 {
|
||||
panic("reflect.nameFrom: tag too long: " + tag[:1024] + "...")
|
||||
panic("abi.NewName: tag too long: " + tag[:1024] + "...")
|
||||
}
|
||||
var nameLen [10]byte
|
||||
var tagLen [10]byte
|
||||
|
|
|
|||
Loading…
Reference in New Issue