From 767ffa2b5f79d0f8458aceab3e628e27fe7a88dc Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Fri, 3 Feb 2017 15:30:42 -0800 Subject: [PATCH] Fix compute_size_with_overflow(). Fix compute_size_with_overflow() to use a high_bits mask that has the high bits set, rather than the low bits. This regression was introduced by 5154ff32ee8c37bacb6afd8a07b923eb33228357 (Unify the allocation paths). --- src/jemalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index 45e9aea7..af410958 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -1521,7 +1521,7 @@ compute_size_with_overflow(dynamic_opts_t *dopts, size_t *size) { */ /* A size_t with its high-half bits all set to 1. */ - const static size_t high_bits = SIZE_T_MAX >> (sizeof(size_t) * 8 / 2); + const static size_t high_bits = SIZE_T_MAX << (sizeof(size_t) * 8 / 2); *size = dopts->item_size * dopts->num_items;