]> granicus.if.org Git - php/commitdiff
This is probably the oldest bug in PHP :)
authorZeev Suraski <zeev@php.net>
Tue, 18 Jul 2000 20:08:06 +0000 (20:08 +0000)
committerZeev Suraski <zeev@php.net>
Tue, 18 Jul 2000 20:08:06 +0000 (20:08 +0000)
Luckily it's unlikely we're ever actually bitten by this bug.

Zend/zend_hash.c

index 979705fa40433bdbeac2115f81037e412cb96d75..88dd1cc0f00aff49642cbadf033783d79585b516 100644 (file)
@@ -123,7 +123,8 @@ static void _zend_is_inconsistent(HashTable *ht, char *file, int line)
 
 /* Generated on an Octa-ALPHA 300MHz CPU & 2.5GB RAM monster */
 static uint PrimeNumbers[] =
-{5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
+       {5, 11, 19, 53, 107, 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793, 2097397, 4194103, 8388857, 16777447, 33554201, 67108961, 134217487, 268435697, 536870683, 1073741621, 2147483399};
+static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(uint);
 
 #define ZEND_HASH_IF_FULL_DO_RESIZE(ht)                                \
        if ((ht)->nNumOfElements > (ht)->nTableSize) {  \
@@ -132,7 +133,6 @@ static uint PrimeNumbers[] =
 
 static int zend_hash_do_resize(HashTable *ht);
 
-static uint nNumPrimeNumbers = sizeof(PrimeNumbers) / sizeof(ulong);
 
 ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
 {