Skip to content

Commit

Permalink
remove magic value
Browse files Browse the repository at this point in the history
  • Loading branch information
monoidic committed Feb 11, 2024
1 parent b345906 commit 259252c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func commonStringCheck(fh fileHandler, entry *dwarf.Entry) (string, dwarfwalkSta
return "", dwStop
}
var addr uint64
if fh.getFileInfo().WordSize == 4 { // 32 bits
if fh.getFileInfo().WordSize == intSize32 {
addr = uint64(fh.getFileInfo().ByteOrder.Uint32(location[1:]))
} else {
addr = fh.getFileInfo().ByteOrder.Uint64(location[1:])
Expand All @@ -108,7 +108,7 @@ func commonStringCheck(fh fileHandler, entry *dwarf.Entry) (string, dwarfwalkSta
off := addr - sectionBase
r := bytes.NewReader(data[off:])
var stringData [2]uint64
if fh.getFileInfo().WordSize == 4 { // 32 bits
if fh.getFileInfo().WordSize == intSize32 {
var stringData32 [2]uint32
err = binary.Read(r, fh.getFileInfo().ByteOrder, &stringData32)
if err != nil {
Expand Down

0 comments on commit 259252c

Please sign in to comment.