Skip to content

Commit

Permalink
debug/pe: use correct pe64 test in ImportedSymbols
Browse files Browse the repository at this point in the history
64-bit PE is set by the optional header magic number,
not by the machine field.

Fixes #54250

Change-Id: I4d01bc08553780d5470e63f0b17bbd968323e5d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/421394
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
  • Loading branch information
ianlancetaylor authored and gopherbot committed Aug 8, 2022
1 parent a34a97d commit d6ccb4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/debug/pe/file.go
Expand Up @@ -322,7 +322,7 @@ func (f *File) ImportedSymbols() ([]string, error) {
return nil, nil
}

pe64 := f.Machine == IMAGE_FILE_MACHINE_AMD64 || f.Machine == IMAGE_FILE_MACHINE_ARM64
_, pe64 := f.OptionalHeader.(*OptionalHeader64)

// grab the number of data directory entries
var dd_length uint32
Expand Down

0 comments on commit d6ccb4e

Please sign in to comment.