runtime: the last section should be len(md.textsectmap)-1

This commit is contained in:
1053226965@qq.com 2023-09-11 14:10:15 +08:00
parent 5eb382fc08
commit bcad6d6619
1 changed files with 1 additions and 1 deletions

View File

@ -622,7 +622,7 @@ func (md *moduledata) textOff(pc uintptr) (uint32, bool) {
}
end := sect.baseaddr + (sect.end - sect.vaddr)
// For the last section, include the end address (etext), as it is included in the functab.
if i == len(md.textsectmap) {
if i == len(md.textsectmap)-1 {
end++
}
if pc < end {