@@ -269,13 +269,12 @@ ZEND_API zend_object *zend_object_make_lazy(zend_object *obj,
269
269
obj = zend_objects_new (reflection_ce );
270
270
271
271
/* Iterate in reverse to avoid overriding Z_PROP_FLAG_P() of child props with added hooks (GH-17870). */
272
- for (uint32_t i = obj -> ce -> default_properties_count - 1 ; i > 0 ; i -- ) {
273
- uint32_t index = i - 1 ;
274
- zval * p = & obj -> properties_table [index ];
272
+ for (int i = obj -> ce -> default_properties_count - 1 ; i >= 0 ; i -- ) {
273
+ zval * p = & obj -> properties_table [i ];
275
274
ZVAL_UNDEF (p );
276
275
Z_PROP_FLAG_P (p ) = 0 ;
277
276
278
- zend_property_info * prop_info = obj -> ce -> properties_info_table [index ];
277
+ zend_property_info * prop_info = obj -> ce -> properties_info_table [i ];
279
278
if (prop_info ) {
280
279
zval * p = & obj -> properties_table [OBJ_PROP_TO_NUM (prop_info -> offset )];
281
280
Z_PROP_FLAG_P (p ) = IS_PROP_UNINIT | IS_PROP_LAZY ;
@@ -327,7 +326,7 @@ ZEND_API zend_object *zend_object_make_lazy(zend_object *obj,
327
326
}
328
327
329
328
/* unset() declared properties */
330
- for (uint32_t i = 0 ; i < reflection_ce -> default_properties_count ; i ++ ) {
329
+ for (int i = 0 ; i < reflection_ce -> default_properties_count ; i ++ ) {
331
330
zend_property_info * prop_info = obj -> ce -> properties_info_table [i ];
332
331
if (EXPECTED (prop_info )) {
333
332
zval * p = & obj -> properties_table [OBJ_PROP_TO_NUM (prop_info -> offset )];
@@ -391,7 +390,7 @@ ZEND_API zend_object *zend_lazy_object_mark_as_initialized(zend_object *obj)
391
390
392
391
OBJ_EXTRA_FLAGS (obj ) &= ~(IS_OBJ_LAZY_UNINITIALIZED |IS_OBJ_LAZY_PROXY );
393
392
394
- for (uint32_t i = 0 ; i < ce -> default_properties_count ; i ++ ) {
393
+ for (int i = 0 ; i < ce -> default_properties_count ; i ++ ) {
395
394
if (Z_PROP_FLAG_P (& properties_table [i ]) & IS_PROP_LAZY ) {
396
395
ZVAL_COPY_PROP (& properties_table [i ], & default_properties_table [i ]);
397
396
}
@@ -411,7 +410,7 @@ static void zend_lazy_object_revert_init(zend_object *obj, zval *properties_tabl
411
410
ZEND_ASSERT (properties_table_snapshot );
412
411
zval * properties_table = obj -> properties_table ;
413
412
414
- for (uint32_t i = 0 ; i < ce -> default_properties_count ; i ++ ) {
413
+ for (int i = 0 ; i < ce -> default_properties_count ; i ++ ) {
415
414
zend_property_info * prop_info = ce -> properties_info_table [i ];
416
415
if (!prop_info ) {
417
416
continue ;
@@ -533,7 +532,7 @@ static zend_object *zend_lazy_object_init_proxy(zend_object *obj)
533
532
zend_object_dtor_dynamic_properties (obj );
534
533
obj -> properties = NULL ;
535
534
536
- for (uint32_t i = 0 ; i < Z_OBJ (retval )-> ce -> default_properties_count ; i ++ ) {
535
+ for (int i = 0 ; i < Z_OBJ (retval )-> ce -> default_properties_count ; i ++ ) {
537
536
zend_property_info * prop_info = Z_OBJ (retval )-> ce -> properties_info_table [i ];
538
537
if (EXPECTED (prop_info )) {
539
538
zval * prop = & obj -> properties_table [OBJ_PROP_TO_NUM (prop_info -> offset )];
@@ -609,7 +608,7 @@ ZEND_API zend_object *zend_lazy_object_init(zend_object *obj)
609
608
zval * properties_table = obj -> properties_table ;
610
609
properties_table_snapshot = emalloc (sizeof (* properties_table_snapshot ) * ce -> default_properties_count );
611
610
612
- for (uint32_t i = 0 ; i < ce -> default_properties_count ; i ++ ) {
611
+ for (int i = 0 ; i < ce -> default_properties_count ; i ++ ) {
613
612
ZVAL_COPY_PROP (& properties_table_snapshot [i ], & properties_table [i ]);
614
613
if (Z_PROP_FLAG_P (& properties_table [i ]) & IS_PROP_LAZY ) {
615
614
ZVAL_COPY_PROP (& properties_table [i ], & default_properties_table [i ]);
@@ -641,7 +640,7 @@ ZEND_API zend_object *zend_lazy_object_init(zend_object *obj)
641
640
}
642
641
643
642
if (properties_table_snapshot ) {
644
- for (uint32_t i = 0 ; i < obj -> ce -> default_properties_count ; i ++ ) {
643
+ for (int i = 0 ; i < obj -> ce -> default_properties_count ; i ++ ) {
645
644
zval * p = & properties_table_snapshot [i ];
646
645
/* Use zval_ptr_dtor directly here (not zend_object_dtor_property),
647
646
* as any reference type_source will have already been deleted in
@@ -682,7 +681,7 @@ void zend_lazy_object_realize(zend_object *obj)
682
681
zend_lazy_object_del_info (obj );
683
682
684
683
#if ZEND_DEBUG
685
- for (uint32_t i = 0 ; i < obj -> ce -> default_properties_count ; i ++ ) {
684
+ for (int i = 0 ; i < obj -> ce -> default_properties_count ; i ++ ) {
686
685
ZEND_ASSERT (!(Z_PROP_FLAG_P (& obj -> properties_table [i ]) & IS_PROP_LAZY ));
687
686
}
688
687
#endif
@@ -733,13 +732,12 @@ zend_object *zend_lazy_object_clone(zend_object *old_obj)
733
732
zend_object * new_proxy = zend_objects_new (ce );
734
733
735
734
/* Iterate in reverse to avoid overriding Z_PROP_FLAG_P() of child props with added hooks (GH-17870). */
736
- for (uint32_t i = ce -> default_properties_count ; i > 0 ; i -- ) {
737
- uint32_t index = i - 1 ;
738
- zval * p = & new_proxy -> properties_table [index ];
735
+ for (int i = ce -> default_properties_count - 1 ; i >= 0 ; i -- ) {
736
+ zval * p = & new_proxy -> properties_table [i ];
739
737
ZVAL_UNDEF (p );
740
738
Z_PROP_FLAG_P (p ) = 0 ;
741
739
742
- zend_property_info * prop_info = ce -> properties_info_table [index ];
740
+ zend_property_info * prop_info = ce -> properties_info_table [i ];
743
741
if (prop_info ) {
744
742
zval * p = & new_proxy -> properties_table [OBJ_PROP_TO_NUM (prop_info -> offset )];
745
743
Z_PROP_FLAG_P (p ) = IS_PROP_UNINIT | IS_PROP_LAZY ;
0 commit comments