diff options
author | Cherry Mui <cherryyz@google.com> | 2021-09-30 11:46:41 -0400 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2021-09-30 16:14:49 +0000 |
commit | b043d231fa1e1cbc17ddcfb007d92d83dee72428 (patch) | |
tree | 36d16cd87906d79d93c6f527b3baa4f908eccbd1 /src/debug | |
parent | 7162c4c7caf72a3f29d3ceee48ff352dab659472 (diff) | |
download | go-b043d231fa1e1cbc17ddcfb007d92d83dee72428.tar.gz go-b043d231fa1e1cbc17ddcfb007d92d83dee72428.zip |
debug/gosym: fix version check in file table access
Go 1.16 and 1.18 table are the same for that part. Accept 1.18
version number in that code.
Fixes #48699.
Change-Id: I44eafa279a94bd06444f61518aedd541b25390fd
Reviewed-on: https://go-review.googlesource.com/c/go/+/353329
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/debug')
-rw-r--r-- | src/debug/gosym/pclntab.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/debug/gosym/pclntab.go b/src/debug/gosym/pclntab.go index fdaa47a917..b2bd914ad7 100644 --- a/src/debug/gosym/pclntab.go +++ b/src/debug/gosym/pclntab.go @@ -490,7 +490,7 @@ func (t *LineTable) findFileLine(entry uint64, filetab, linetab uint32, filenum, fileStartPC := filePC for t.step(&fp, &filePC, &fileVal, filePC == entry) { fileIndex := fileVal - if t.version == ver116 { + if t.version == ver116 || t.version == ver118 { fileIndex = int32(t.binary.Uint32(cutab[fileVal*4:])) } if fileIndex == filenum && fileStartPC < filePC { @@ -589,7 +589,7 @@ func (t *LineTable) go12LineToPC(file string, line int) (pc uint64) { entry := f.entryPC() filetab := f.pcfile() linetab := f.pcln() - if t.version == ver116 { + if t.version == ver116 || t.version == ver118 { cutab = t.cutab[f.cuOffset()*4:] } pc := t.findFileLine(entry, filetab, linetab, int32(filenum), int32(line), cutab) |