@@ -3252,17 +3252,17 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3252
3252
3253
3253
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3254
3254
if (removed != NULL ) {
3255
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3255
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3256
3256
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3257
3257
pos ++ ;
3258
3258
Z_TRY_ADDREF_P (entry );
3259
3259
zend_hash_next_index_insert_new (removed , entry );
3260
3260
zend_hash_packed_del_val (in_hash , entry );
3261
3261
}
3262
3262
} else { /* otherwise just skip those entries */
3263
- int pos2 = pos ;
3263
+ zend_long pos2 = pos ;
3264
3264
3265
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3265
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3266
3266
if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
3267
3267
pos2 ++ ;
3268
3268
zend_hash_packed_del_val (in_hash , entry );
@@ -3317,7 +3317,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3317
3317
3318
3318
/* If hash for removed entries exists, go until offset+length and copy the entries to it */
3319
3319
if (removed != NULL ) {
3320
- for ( ; pos < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3320
+ for ( ; pos - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3321
3321
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3322
3322
pos ++ ;
3323
3323
entry = & p -> val ;
@@ -3330,9 +3330,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
3330
3330
zend_hash_del_bucket (in_hash , p );
3331
3331
}
3332
3332
} else { /* otherwise just skip those entries */
3333
- int pos2 = pos ;
3333
+ zend_long pos2 = pos ;
3334
3334
3335
- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3335
+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3336
3336
if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
3337
3337
pos2 ++ ;
3338
3338
zend_hash_del_bucket (in_hash , p );
0 commit comments