From b71ca76065823af0908ff469f603c0b38a7c4177 Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Sat, 3 Sep 2022 20:08:12 +0000 Subject: [PATCH] debug/buildinfo: remove redundant type conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia8ffc9a17646ad2c74f633610aaf34fef006c023 GitHub-Last-Rev: 6ab0d107393c9bdfeaed5c539efb452942c00394 GitHub-Pull-Request: golang/go#54856 Reviewed-on: https://go-review.googlesource.com/c/go/+/428235 Auto-Submit: Ian Lance Taylor Reviewed-by: Tobias Klauser Reviewed-by: Daniel Martí Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Run-TryBot: Tobias Klauser Reviewed-by: Ian Lance Taylor Reviewed-by: Michael Knyszek --- src/debug/buildinfo/buildinfo.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug/buildinfo/buildinfo.go b/src/debug/buildinfo/buildinfo.go index 3dbe3fe41d..ef77f28ce5 100644 --- a/src/debug/buildinfo/buildinfo.go +++ b/src/debug/buildinfo/buildinfo.go @@ -394,13 +394,13 @@ type xcoffExe struct { func (x *xcoffExe) ReadData(addr, size uint64) ([]byte, error) { for _, sect := range x.f.Sections { - if uint64(sect.VirtualAddress) <= addr && addr <= uint64(sect.VirtualAddress+sect.Size-1) { - n := uint64(sect.VirtualAddress+sect.Size) - addr + if sect.VirtualAddress <= addr && addr <= sect.VirtualAddress+sect.Size-1 { + n := sect.VirtualAddress + sect.Size - addr if n > size { n = size } data := make([]byte, n) - _, err := sect.ReadAt(data, int64(addr-uint64(sect.VirtualAddress))) + _, err := sect.ReadAt(data, int64(addr-sect.VirtualAddress)) if err != nil { return nil, err }