mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Replace OBJ_PROP_PTR_TO_NUM() with zend_get_property_info_for_slot()
I wasn't aware such a function already existed.
This commit is contained in:
@@ -438,8 +438,6 @@ typedef struct _zend_property_info {
|
||||
((uint32_t)(XtOffsetOf(zend_object, properties_table) + sizeof(zval) * (num)))
|
||||
#define OBJ_PROP_TO_NUM(offset) \
|
||||
((offset - OBJ_PROP_TO_OFFSET(0)) / sizeof(zval))
|
||||
#define OBJ_PROP_PTR_TO_NUM(obj, prop) \
|
||||
(((char*)prop - (char*)obj->properties_table) / sizeof(zval))
|
||||
|
||||
typedef struct _zend_class_constant {
|
||||
zval value; /* flags are stored in u2 */
|
||||
|
||||
@@ -141,8 +141,7 @@ static void zho_declared_it_fetch_current(zend_object_iterator *iter)
|
||||
} else if (Z_TYPE_P(property) != IS_REFERENCE) {
|
||||
ZVAL_MAKE_REF(property);
|
||||
|
||||
zend_class_entry *ce = zobj->ce;
|
||||
zend_property_info *prop_info = ce->properties_info_table[OBJ_PROP_PTR_TO_NUM(zobj, property)];
|
||||
zend_property_info *prop_info = zend_get_property_info_for_slot(zobj, property);
|
||||
if (ZEND_TYPE_IS_SET(prop_info->type)) {
|
||||
ZEND_REF_ADD_TYPE_SOURCE(Z_REF_P(property), prop_info);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user