Skip to content

Commit

Permalink
Do not change scope in zephir_update_property_zval. See aa126bc
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Apr 16, 2020
1 parent aa126bc commit 216a8fd
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions kernels/ZendEngine3/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ int zephir_init_property_zval(zval *object, const char *property_name,
int zephir_update_property_zval(zval *object, const char *property_name,
unsigned int property_length, zval *value)
{
zend_class_entry *ce, *scope;
zend_class_entry *ce;
zval property, sep_value;

if (Z_TYPE_P(object) != IS_OBJECT) {
Expand All @@ -660,9 +660,6 @@ int zephir_update_property_zval(zval *object, const char *property_name,
return FAILURE;
}

/* Backup current scope */
scope = zephir_get_scope(0);

/* Is this function was called from within caller scope */
ce = zend_get_called_scope(EG(current_execute_data));
if (UNEXPECTED(!ce)) {
Expand All @@ -674,9 +671,6 @@ int zephir_update_property_zval(zval *object, const char *property_name,
ce = zephir_lookup_class_ce(ce, property_name, property_length);
}

/* Use caller's scope */
zephir_set_scope(ce);

if (!Z_OBJ_HT_P(object)->write_property) {
const char *class_name;

Expand All @@ -702,9 +696,6 @@ int zephir_update_property_zval(zval *object, const char *property_name,
Z_OBJ_HT_P(object)->write_property(object, &property, &sep_value, 0);
zval_ptr_dtor(&property);

/* Restore original scope */
zephir_set_scope(scope);

return SUCCESS;
}

Expand Down

0 comments on commit 216a8fd

Please sign in to comment.