@@ -3252,17 +3252,17 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
32523252
32533253 /* If hash for removed entries exists, go until offset+length and copy the entries to it */
32543254 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 ++ ) {
32563256 if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
32573257 pos ++ ;
32583258 Z_TRY_ADDREF_P (entry );
32593259 zend_hash_next_index_insert_new (removed , entry );
32603260 zend_hash_packed_del_val (in_hash , entry );
32613261 }
32623262 } else { /* otherwise just skip those entries */
3263- int pos2 = pos ;
3263+ zend_long pos2 = pos ;
32643264
3265- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
3265+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , entry ++ ) {
32663266 if (Z_TYPE_P (entry ) == IS_UNDEF ) continue ;
32673267 pos2 ++ ;
32683268 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
33173317
33183318 /* If hash for removed entries exists, go until offset+length and copy the entries to it */
33193319 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 ++ ) {
33213321 if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
33223322 pos ++ ;
33233323 entry = & p -> val ;
@@ -3330,9 +3330,9 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H
33303330 zend_hash_del_bucket (in_hash , p );
33313331 }
33323332 } else { /* otherwise just skip those entries */
3333- int pos2 = pos ;
3333+ zend_long pos2 = pos ;
33343334
3335- for ( ; pos2 < offset + length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
3335+ for ( ; pos2 - offset < length && idx < in_hash -> nNumUsed ; idx ++ , p ++ ) {
33363336 if (Z_TYPE (p -> val ) == IS_UNDEF ) continue ;
33373337 pos2 ++ ;
33383338 zend_hash_del_bucket (in_hash , p );
0 commit comments