Skip to content

Commit

Permalink
debug: fix missing C style error handling in xcoffExe.DataStart
Browse files Browse the repository at this point in the history
I've made it return 0 following what the other DataStart implementation
do when they do not found the section.

Fixes #52718
  • Loading branch information
Jorropo committed May 5, 2022
1 parent e1e056f commit 081a35e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/debug/buildinfo/buildinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 081a35e

Please sign in to comment.