summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-20 08:56:17 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-20 09:45:25 +0000
commit234bc82308b00d315360073f1316700fa688a38f (patch)
treecaafb9e3ab3712bde63d21f0cc9152272044a94f /sal
parent3d10c608b05f648c5ff09f68a76b88090572b831 (diff)
silence coverity#1202740 Bad bit shift operation
Change-Id: I88c38a1a7eae0d1e2011c40983490efef1ff6438
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/alloc_cache.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index fd8a8c03205e..1529626e0537 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -130,7 +130,9 @@ rtl_cache_hash_rescale (
cache->m_hash_table = new_table;
cache->m_hash_size = new_size;
- cache->m_hash_shift = highbit(cache->m_hash_size) - 1;
+ const auto bit = highbit(cache->m_hash_size);
+ assert(bit > 0);
+ cache->m_hash_shift = bit - 1;
for (i = 0; i < old_size; i++)
{