summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-31 15:23:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-10-31 15:23:12 +0100
commit8dbe4f2aebff1bd763e4f44c8f9e2a367316da4b (patch)
tree213081e458e55e4347f90ad3f11cf499ac955294 /sal
parent4f93d6960c4a3d56f066c72ca815beeb24e5d960 (diff)
cid#1202756 Clarify with assert that ave == 0 cannot happen
...so (highbit(ave) - 1) will never be negative and never cause undefined shift by negative value. Change-Id: I86703f03d30d48c74d2e814c182b9edb85d18186
Diffstat (limited to 'sal')
-rw-r--r--sal/rtl/alloc_arena.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 1ed149752e17..c49f147c4ba2 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -392,6 +392,7 @@ rtl_arena_hash_remove (
if (!(arena->m_flags & RTL_ARENA_FLAG_RESCALE))
{
sal_Size ave = nseg >> arena->m_hash_shift;
+ assert(ave != 0);
sal_Size new_size = arena->m_hash_size << (highbit(ave) - 1);
arena->m_flags |= RTL_ARENA_FLAG_RESCALE;