Skip to content

Commit 4a6bbb8

Browse files
Kenotkelman
authored andcommitted
Fix reflection test failure on 32bit (#19885)
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.
1 parent 5b6ff4a commit 4a6bbb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/disasm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,13 @@ void SymbolTable::insertAddress(uint64_t addr)
235235
// Create symbols for all addresses
236236
void SymbolTable::createSymbols()
237237
{
238-
uint64_t Fptr = (uint64_t)MemObj.data();
239-
uint64_t Fsize = MemObj.size();
238+
uintptr_t Fptr = (uintptr_t)MemObj.data();
239+
uintptr_t Fsize = MemObj.size();
240240
for (TableType::iterator isymb = Table.begin(), esymb = Table.end();
241241
isymb != esymb; ++isymb) {
242242
std::ostringstream name;
243-
uint64_t rel = isymb->first - ip;
244-
uint64_t addr = isymb->first;
243+
uintptr_t rel = isymb->first - ip;
244+
uintptr_t addr = isymb->first;
245245
if (Fptr <= addr && addr < Fptr + Fsize) {
246246
name << "L" << rel;
247247
}

0 commit comments

Comments
 (0)