diff options
author | Dmitry Stogov <dmitry@zend.com> | 2016-04-28 04:13:34 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2016-04-28 04:13:34 +0300 |
commit | 6499162ff0d8aa6e862d3e3cdd2288b87636b8a1 (patch) | |
tree | b1de28564ceb5249bd207a6291fff0ab3dac877f /Zend/zend_objects.c | |
parent | 8339222106ac38090e9790f1abbbe2c70c1840fd (diff) | |
download | php-git-6499162ff0d8aa6e862d3e3cdd2288b87636b8a1.tar.gz |
- get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r-- | Zend/zend_objects.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 0f052335db..53d215d27e 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -96,39 +96,39 @@ ZEND_API void zend_objects_destroy_object(zend_object *object) if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) { /* Ensure that if we're calling a private function, we're allowed to do so. */ - if (object->ce != EG(scope)) { - zend_class_entry *ce = object->ce; + if (EG(current_execute_data)) { + zend_class_entry *scope = zend_get_executed_scope(); - if (EG(current_execute_data)) { + if (object->ce != scope) { zend_throw_error(NULL, "Call to private %s::__destruct() from context '%s'", - ZSTR_VAL(ce->name), - EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); - } else { - zend_error(E_WARNING, - "Call to private %s::__destruct() from context '%s' during shutdown ignored", - ZSTR_VAL(ce->name), - EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + ZSTR_VAL(object->ce->name), + scope ? ZSTR_VAL(scope->name) : ""); + return; } + } else { + zend_error(E_WARNING, + "Call to private %s::__destruct() from context '' during shutdown ignored", + ZSTR_VAL(object->ce->name)); return; } } else { /* Ensure that if we're calling a protected function, we're allowed to do so. */ - if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) { - zend_class_entry *ce = object->ce; + if (EG(current_execute_data)) { + zend_class_entry *scope = zend_get_executed_scope(); - if (EG(current_execute_data)) { + if (!zend_check_protected(zend_get_function_root_class(destructor), scope)) { zend_throw_error(NULL, "Call to protected %s::__destruct() from context '%s'", - ZSTR_VAL(ce->name), - EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); - } else { - zend_error(E_WARNING, - "Call to protected %s::__destruct() from context '%s' during shutdown ignored", - ZSTR_VAL(ce->name), - EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + ZSTR_VAL(object->ce->name), + scope ? ZSTR_VAL(scope->name) : ""); + return; } + } else { + zend_error(E_WARNING, + "Call to protected %s::__destruct() from context '' during shutdown ignored", + ZSTR_VAL(object->ce->name)); return; } } |