Skip to content

Commit

Permalink
Fix reflection test failure on 32bit (#19885)
Browse files Browse the repository at this point in the history
The bug here is that one of the pointers gets zero extended (isymb->first),
while the other (Fptr) gets sign extended, so comparing the two breaks down.
The simplest way to fix, is just to use the appropriate integer size for the
platform we're on.
  • Loading branch information
Keno authored and tkelman committed Jan 6, 2017
1 parent 5b6ff4a commit 4a6bbb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/disasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ void SymbolTable::insertAddress(uint64_t addr)
// Create symbols for all addresses
void SymbolTable::createSymbols()
{
uint64_t Fptr = (uint64_t)MemObj.data();
uint64_t Fsize = MemObj.size();
uintptr_t Fptr = (uintptr_t)MemObj.data();
uintptr_t Fsize = MemObj.size();
for (TableType::iterator isymb = Table.begin(), esymb = Table.end();
isymb != esymb; ++isymb) {
std::ostringstream name;
uint64_t rel = isymb->first - ip;
uint64_t addr = isymb->first;
uintptr_t rel = isymb->first - ip;
uintptr_t addr = isymb->first;
if (Fptr <= addr && addr < Fptr + Fsize) {
name << "L" << rel;
}
Expand Down

0 comments on commit 4a6bbb8

Please sign in to comment.