diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-09-09 23:03:26 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-09-09 23:05:00 +0200 |
commit | 245ea60b0e0f7d7abcc8ab3b693439df5f93fed9 (patch) | |
tree | c4ee735626faee5f742ace6374d0ca332938f694 | |
parent | b8253693b79fc9242f73aee7ffd75b5e9a4092f5 (diff) | |
download | glibc-master.zip glibc-master.tar.gz glibc-master.tar.bz2 |
instead of undefined cases from casting uintptr_t into intptr_t.
-rw-r--r-- | malloc/malloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index 444dc61..18ef6b5 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -3150,7 +3150,8 @@ tcache_key_initialize (void) int minimum_bits = __WORDSIZE / 4; int maximum_bits = __WORDSIZE - minimum_bits; - while (labs ((intptr_t) tcache_key) <= 0x1000000 + while (tcache_key <= 0x1000000 + || tcache_key >= ((uintptr_t) ULONG_MAX) - 0x1000000 || stdc_count_ones (tcache_key) < minimum_bits || stdc_count_ones (tcache_key) > maximum_bits) { |