@@ -3364,7 +3364,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3364
3364
3365
3365
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3366
3366
if (removed != NULL ) {
3367
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3367
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3368
3368
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3369
3369
pos ++ ;
3370
3370
Z_TRY_ADDREF_P (entry );
@@ -3377,9 +3377,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3377
3377
}
3378
3378
}
3379
3379
} else { /* otherwise just skip those entries */
3380
- int pos2 = pos ;
3380
+ zend_long pos2 = pos ;
3381
3381
3382
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3382
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3383
3383
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3384
3384
pos2 ++ ;
3385
3385
zend_hash_packed_del_val (in_hash , entry );
@@ -3438,7 +3438,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3438
3438
3439
3439
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3440
3440
if (removed != NULL ) {
3441
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3441
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3442
3442
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3443
3443
pos ++ ;
3444
3444
entry = & p -> val ;
@@ -3451,9 +3451,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3451
3451
zend_hash_del_bucket (in_hash , p );
3452
3452
}
3453
3453
} else { /* otherwise just skip those entries */
3454
- int pos2 = pos ;
3454
+ zend_long pos2 = pos ;
3455
3455
3456
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3456
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3457
3457
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3458
3458
pos2 ++ ;
3459
3459
zend_hash_del_bucket (in_hash , p );
0 commit comments