@@ -3356,7 +3356,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3356
3356
3357
3357
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3358
3358
if (removed != NULL ) {
3359
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3359
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3360
3360
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3361
3361
pos ++ ;
3362
3362
Z_TRY_ADDREF_P (entry );
@@ -3369,9 +3369,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3369
3369
}
3370
3370
}
3371
3371
} else { /* otherwise just skip those entries */
3372
- int pos2 = pos ;
3372
+ zend_long pos2 = pos ;
3373
3373
3374
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3374
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3375
3375
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3376
3376
pos2 ++ ;
3377
3377
zend_hash_packed_del_val (in_hash , entry );
@@ -3430,7 +3430,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3430
3430
3431
3431
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3432
3432
if (removed != NULL ) {
3433
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3433
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3434
3434
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3435
3435
pos ++ ;
3436
3436
entry = & p -> val ;
@@ -3443,9 +3443,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3443
3443
zend_hash_del_bucket (in_hash , p );
3444
3444
}
3445
3445
} else { /* otherwise just skip those entries */
3446
- int pos2 = pos ;
3446
+ zend_long pos2 = pos ;
3447
3447
3448
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3448
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3449
3449
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3450
3450
pos2 ++ ;
3451
3451
zend_hash_del_bucket (in_hash , p );
0 commit comments