@@ -3356,7 +3356,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
33563356
33573357 /* If hash for removed entries exists, go until offset+length and copy the entries to it */
33583358 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 ++ ) {
33603360 if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
33613361 pos ++ ;
33623362 Z_TRY_ADDREF_P (entry );
@@ -3369,9 +3369,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
33693369 }
33703370 }
33713371 } else { /* otherwise just skip those entries */
3372- int pos2 = pos ;
3372+ zend_long pos2 = pos ;
33733373
3374- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3374+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
33753375 if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
33763376 pos2 ++ ;
33773377 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
34303430
34313431 /* If hash for removed entries exists, go until offset+length and copy the entries to it */
34323432 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 ++ ) {
34343434 if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
34353435 pos ++ ;
34363436 entry = & p -> val ;
@@ -3443,9 +3443,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
34433443 zend_hash_del_bucket (in_hash , p );
34443444 }
34453445 } else { /* otherwise just skip those entries */
3446- int pos2 = pos ;
3446+ zend_long pos2 = pos ;
34473447
3448- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3448+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
34493449 if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
34503450 pos2 ++ ;
34513451 zend_hash_del_bucket (in_hash , p );
0 commit comments