From 0253580a75decdaf22b6abce60d8265b2adb7dea Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 21 Dec 2018 09:49:37 -0200 Subject: Replace check_mul_overflow_size_t with __builtin_mul_overflow Checked on x86_64-linux-gnu and i686-linux-gnu. * malloc/alloc_buffer_alloc_array.c (__libc_alloc_buffer_alloc_array): Use __builtin_mul_overflow in place of check_mul_overflow_size_t. * malloc/dynarray_emplace_enlarge.c (__libc_dynarray_emplace_enlarge): Likewise. * malloc/dynarray_resize.c (__libc_dynarray_resize): Likewise. * malloc/reallocarray.c (__libc_reallocarray): Likewise. * malloc/malloc-internal.h (check_mul_overflow_size_t): Remove function. * support/blob_repeat.c (check_mul_overflow_size_t, (minimum_stride_size, support_blob_repeat_allocate): Likewise. --- malloc/dynarray_resize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'malloc/dynarray_resize.c') diff --git a/malloc/dynarray_resize.c b/malloc/dynarray_resize.c index 0bfca1ba4b..0205cf7ab2 100644 --- a/malloc/dynarray_resize.c +++ b/malloc/dynarray_resize.c @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -38,7 +37,7 @@ __libc_dynarray_resize (struct dynarray_header *list, size_t size, over-allocation here. */ size_t new_size_bytes; - if (check_mul_overflow_size_t (size, element_size, &new_size_bytes)) + if (__builtin_mul_overflow (size, element_size, &new_size_bytes)) { /* Overflow. */ __set_errno (ENOMEM); -- cgit v1.2.3-70-g09d2