@@ -1211,7 +1211,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
12111211
12121212 for (i = 0 ; i < class_type -> default_properties_count ; i ++ ) {
12131213 if (Z_TYPE (class_type -> default_properties_table [i ]) != IS_UNDEF ) {
1214- zval_update_class_constant (& class_type -> default_properties_table [i ], 0 , i TSRMLS_CC );
1214+ zval_update_class_constant (& class_type -> default_properties_table [i ], 0 , OBJ_PROP_TO_OFFSET ( i ) TSRMLS_CC );
12151215 }
12161216 }
12171217
@@ -1255,8 +1255,9 @@ ZEND_API void object_properties_init_ex(zend_object *object, HashTable *properti
12551255 if (property_info != ZEND_WRONG_PROPERTY_INFO &&
12561256 property_info &&
12571257 (property_info -> flags & ZEND_ACC_STATIC ) == 0 ) {
1258- ZVAL_COPY_VALUE (& object -> properties_table [property_info -> offset ], prop );
1259- ZVAL_INDIRECT (prop , & object -> properties_table [property_info -> offset ]);
1258+ zval * slot = OBJ_PROP (object , property_info -> offset );
1259+ ZVAL_COPY_VALUE (slot , prop );
1260+ ZVAL_INDIRECT (prop , slot );
12601261 }
12611262 } ZEND_HASH_FOREACH_END ();
12621263 }
@@ -1274,11 +1275,12 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties
12741275 if (property_info != ZEND_WRONG_PROPERTY_INFO &&
12751276 property_info &&
12761277 (property_info -> flags & ZEND_ACC_STATIC ) == 0 ) {
1277- zval_ptr_dtor (& object -> properties_table [property_info -> offset ]);
1278- ZVAL_COPY_VALUE (& object -> properties_table [property_info -> offset ], prop );
1279- zval_add_ref (& object -> properties_table [property_info -> offset ]);
1278+ zval * slot = OBJ_PROP (object , property_info -> offset );
1279+ zval_ptr_dtor (slot );
1280+ ZVAL_COPY_VALUE (slot , prop );
1281+ zval_add_ref (slot );
12801282 if (object -> properties ) {
1281- ZVAL_INDIRECT (& tmp , & object -> properties_table [ property_info -> offset ] );
1283+ ZVAL_INDIRECT (& tmp , slot );
12821284 zend_hash_update (object -> properties , key , & tmp );
12831285 }
12841286 } else {
@@ -3622,13 +3624,14 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
36223624 if ((property_info_ptr = zend_hash_find_ptr (& ce -> properties_info , name )) != NULL &&
36233625 (property_info_ptr -> flags & ZEND_ACC_STATIC ) == 0 ) {
36243626 property_info -> offset = property_info_ptr -> offset ;
3625- zval_ptr_dtor (& ce -> default_properties_table [property_info -> offset ]);
3627+ zval_ptr_dtor (& ce -> default_properties_table [OBJ_PROP_TO_NUM ( property_info -> offset ) ]);
36263628 zend_hash_del (& ce -> properties_info , name );
36273629 } else {
3628- property_info -> offset = ce -> default_properties_count ++ ;
3630+ property_info -> offset = OBJ_PROP_TO_OFFSET (ce -> default_properties_count );
3631+ ce -> default_properties_count ++ ;
36293632 ce -> default_properties_table = perealloc (ce -> default_properties_table , sizeof (zval ) * ce -> default_properties_count , ce -> type == ZEND_INTERNAL_CLASS );
36303633 }
3631- ZVAL_COPY_VALUE (& ce -> default_properties_table [property_info -> offset ], property );
3634+ ZVAL_COPY_VALUE (& ce -> default_properties_table [OBJ_PROP_TO_NUM ( property_info -> offset ) ], property );
36323635 }
36333636 if (ce -> type & ZEND_INTERNAL_CLASS ) {
36343637 switch (Z_TYPE_P (property )) {
0 commit comments