@@ -168,7 +168,7 @@ static zend_always_inline void zend_hash_real_init_mixed_ex(HashTable *ht)
168168 void * data ;
169169 uint32_t nSize = ht -> nTableSize ;
170170
171- ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ));
171+ ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ) != 0 );
172172
173173 if (UNEXPECTED (GC_FLAGS (ht ) & IS_ARRAY_PERSISTENT )) {
174174 data = pemalloc (HT_SIZE_EX (nSize , HT_SIZE_TO_MASK (nSize )), 1 );
@@ -350,7 +350,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht)
350350 uint32_t i ;
351351 uint32_t nSize = ht -> nTableSize ;
352352
353- ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ));
353+ ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ) != 0 );
354354
355355 HT_ASSERT_RC1 (ht );
356356 // Alloc before assign to avoid inconsistencies on OOM
@@ -398,7 +398,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool
398398
399399 if (nSize == 0 ) return ;
400400
401- ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ));
401+ ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ) != 0 );
402402
403403 if (UNEXPECTED (HT_FLAGS (ht ) & HASH_FLAG_UNINITIALIZED )) {
404404 if (nSize > ht -> nTableSize ) {
@@ -1324,7 +1324,7 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht)
13241324 uint32_t nSize = ht -> nTableSize + ht -> nTableSize ;
13251325 Bucket * old_buckets = ht -> arData ;
13261326
1327- ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ));
1327+ ZEND_ASSERT (HT_SIZE_TO_MASK (nSize ) != 0 );
13281328
13291329 new_data = pemalloc (HT_SIZE_EX (nSize , HT_SIZE_TO_MASK (nSize )), GC_FLAGS (ht ) & IS_ARRAY_PERSISTENT );
13301330 ht -> nTableSize = nSize ;
0 commit comments