1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-07-02 13:41:46 +02:00

dwarf: error in unmap size arguments

This patch fixes an error in the unmapping of
hash table memory when the dwarf hash table is resized.
This commit is contained in:
Doug Moore 2017-04-17 12:22:36 -05:00 committed by Dave Watson
parent 0f24c6dec8
commit 24f27f02ac

View file

@ -524,9 +524,11 @@ dwarf_flush_rs_cache (struct dwarf_rs_cache *cache)
cache->log_size = DWARF_DEFAULT_LOG_UNW_CACHE_SIZE;
} else {
if (cache->hash && cache->hash != cache->default_hash)
munmap(cache->hash, DWARF_UNW_HASH_SIZE(cache->prev_log_size));
munmap(cache->hash, DWARF_UNW_HASH_SIZE(cache->prev_log_size)
* sizeof (cache->hash[0]));
if (cache->buckets && cache->buckets != cache->default_buckets)
munmap(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->prev_log_size));
munmap(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->prev_log_size)
* sizeof (cache->buckets[0]));
GET_MEMORY(cache->hash, DWARF_UNW_HASH_SIZE(cache->log_size)
* sizeof (cache->hash[0]));
GET_MEMORY(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->log_size)