[Libreoffice-commits] core.git: sal/rtl
Stephan Bergmann
sbergman at redhat.com
Fri Oct 31 07:23:44 PDT 2014
sal/rtl/alloc_arena.cxx | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 8dbe4f2aebff1bd763e4f44c8f9e2a367316da4b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Oct 31 15:23:12 2014 +0100
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
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index 1ed1497..c49f147 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;
More information about the Libreoffice-commits
mailing list