mirror of
https://github.com/golang/go
synced 2024-11-21 17:14:45 -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:
parent
dd6dee48b2
commit
97855d171e
@ -467,10 +467,10 @@ func (f funcData) pcln() uint32 { return f.field(6) }
|
||||
func (f funcData) cuOffset() uint32 { return f.field(8) }
|
||||
|
||||
// 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).
|
||||
func (f funcData) field(n uint32) uint32 {
|
||||
if n == 0 || n > 9 {
|
||||
if n == 0 || n > 10 {
|
||||
panic("bad funcdata field")
|
||||
}
|
||||
// In Go 1.18, the first field of _func changed
|
||||
|
Loading…
Reference in New Issue
Block a user