1
0
mirror of https://github.com/golang/go synced 2024-09-29 14:14:29 -06:00

debug: fix missing C style error handling in xcoffExe.DataStart

I've made it return 0 following what the other DataStart implementation
do when they do not found the section.

Fixes #52718
This commit is contained in:
Jorropo 2022-05-05 14:54:04 +02:00
parent e1e056fa6a
commit 081a35ebec

View File

@ -393,5 +393,8 @@ func (x *xcoffExe) ReadData(addr, size uint64) ([]byte, error) {
}
func (x *xcoffExe) DataStart() uint64 {
return x.f.SectionByType(xcoff.STYP_DATA).VirtualAddress
if s := x.f.SectionByType(xcoff.STYP_DATA); s != nil {
return s.VirtualAddress
}
return 0
}