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

debug/gosym: update field count to 1.20+

The _func structure in src/runtime/runtime2.go
includes a startLine field in versions after 1.20,
which extends the total number of fields to 10
This commit is contained in:
Zxilly 2024-05-10 01:26:06 +08:00
parent dd6dee48b2
commit 97855d171e

View File

@ -467,10 +467,10 @@ func (f funcData) pcln() uint32 { return f.field(6) }
func (f funcData) cuOffset() uint32 { return f.field(8) } func (f funcData) cuOffset() uint32 { return f.field(8) }
// field returns the nth field of the _func struct. // field returns the nth field of the _func struct.
// It panics if n == 0 or n > 9; for n == 0, call f.entryPC. // It panics if n == 0 or n > 10; for n == 0, call f.entryPC.
// Most callers should use a named field accessor (just above). // Most callers should use a named field accessor (just above).
func (f funcData) field(n uint32) uint32 { func (f funcData) field(n uint32) uint32 {
if n == 0 || n > 9 { if n == 0 || n > 10 {
panic("bad funcdata field") panic("bad funcdata field")
} }
// In Go 1.18, the first field of _func changed // In Go 1.18, the first field of _func changed