Accept zend_object* in zend_unset_property

This commit is contained in:
Nikita Popov 2020-08-07 15:17:59 +02:00
parent 978b7de244
commit 01cbb5967c
4 changed files with 5 additions and 5 deletions

View File

@ -4007,7 +4007,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
}
/* }}} */
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length) /* {{{ */
{
zend_string *property;
zend_class_entry *old_scope = EG(fake_scope);
@ -4015,7 +4015,7 @@ ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const c
EG(fake_scope) = scope;
property = zend_string_init(name, name_length, 0);
Z_OBJ_HT_P(object)->unset_property(Z_OBJ_P(object), property, 0);
object->handlers->unset_property(object, property, 0);
zend_string_release_ex(property, 0);
EG(fake_scope) = old_scope;

View File

@ -389,7 +389,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_str(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_string *value);
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value);
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, const char *name, size_t name_length, const char *value, size_t value_length);
ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length);
ZEND_API void zend_unset_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length);
ZEND_API int zend_update_static_property_ex(zend_class_entry *scope, zend_string *name, zval *value);
ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value);

View File

@ -311,7 +311,7 @@ ZEND_METHOD(Exception, __construct)
#define CHECK_EXC_TYPE(id, type) \
pvalue = zend_read_property_ex(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_KNOWN(id), 1, &value); \
if (Z_TYPE_P(pvalue) != IS_NULL && Z_TYPE_P(pvalue) != type) { \
zend_unset_property(i_get_exception_base(Z_OBJ_P(object)), object, ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
zend_unset_property(i_get_exception_base(Z_OBJ_P(object)), Z_OBJ_P(object), ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
}
ZEND_METHOD(Exception, __wakeup)

View File

@ -1185,7 +1185,7 @@ static zval* get_zval_property(zval* object, char* name, zval *rv)
static void unset_zval_property(zval* object, char* name)
{
if (Z_TYPE_P(object) == IS_OBJECT) {
zend_unset_property(Z_OBJCE_P(object), object, name, strlen(name));
zend_unset_property(Z_OBJCE_P(object), Z_OBJ_P(object), name, strlen(name));
} else if (Z_TYPE_P(object) == IS_ARRAY) {
zend_hash_str_del(Z_ARRVAL_P(object), name, strlen(name));
}