mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-24 20:30:06 +00:00
Make 32-bit member offset in Archive::Symbol::getMember 64-bit
When accessing a member for a symbol with an offset greater than 2^32 - 1 the current Archive::Symbol::getMember implementation will overflow and cause unexpected behavior. This change simply fixes that. In particular if you call "llvm-nm --print-armap" on an archive that has this behavior you'll get an error. Differential Revision: https://reviews.llvm.org/D39379 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6861d89ae5
commit
9a8a8159d3
@ -801,7 +801,7 @@ Expected<Archive::Child> Archive::Symbol::getMember() const {
|
||||
Offsets += sizeof(uint64_t);
|
||||
else
|
||||
Offsets += sizeof(uint32_t);
|
||||
uint32_t Offset = 0;
|
||||
uint64_t Offset = 0;
|
||||
if (Parent->kind() == K_GNU) {
|
||||
Offset = read32be(Offsets + SymbolIndex * 4);
|
||||
} else if (Parent->kind() == K_GNU64) {
|
||||
|
Loading…
Reference in New Issue
Block a user