Skip to content

Commit

Permalink
Fix segfault in allocator_tests/arena_tests
Browse files Browse the repository at this point in the history
The test uses reinterpret_cast<void*> on unallocated memory. Using this
memory in printchunk as char* causes a segfault, so have printchunk take
void* instead.
  • Loading branch information
jkczyz authored and div72 committed Dec 24, 2023
1 parent a79368b commit e4efde6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/support/lockedpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Arena::Stats Arena::stats() const
}

#ifdef ARENA_DEBUG
static void printchunk(char* base, size_t sz, bool used) {
static void printchunk(void* base, size_t sz, bool used) {
std::cout <<
"0x" << std::hex << std::setw(16) << std::setfill('0') << base <<
" 0x" << std::hex << std::setw(16) << std::setfill('0') << sz <<
Expand Down

0 comments on commit e4efde6

Please sign in to comment.