aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/debug/macho/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/debug/macho/file.go')
-rw-r--r--src/pkg/debug/macho/file.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkg/debug/macho/file.go b/src/pkg/debug/macho/file.go
index c799fa49df..2b19f7f658 100644
--- a/src/pkg/debug/macho/file.go
+++ b/src/pkg/debug/macho/file.go
@@ -74,6 +74,9 @@ type Segment struct {
func (s *Segment) Data() ([]byte, error) {
dat := make([]byte, s.sr.Size())
n, err := s.sr.ReadAt(dat, 0)
+ if n == len(dat) {
+ err = nil
+ }
return dat[0:n], err
}
@@ -109,6 +112,9 @@ type Section struct {
func (s *Section) Data() ([]byte, error) {
dat := make([]byte, s.sr.Size())
n, err := s.sr.ReadAt(dat, 0)
+ if n == len(dat) {
+ err = nil
+ }
return dat[0:n], err
}