summaryrefslogtreecommitdiff
path: root/Zend/zend_objects.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-05-13 11:55:09 +0300
committerDmitry Stogov <dmitry@zend.com>2016-05-13 11:55:09 +0300
commite9c3f9fcde1013cc1c9bdead7e16478a108d7907 (patch)
tree0febdec537962f48a78e5e5e74d44a585240b75a /Zend/zend_objects.c
parentee8f402af8c964acac5740ee1677a7b47e20a883 (diff)
downloadphp-git-e9c3f9fcde1013cc1c9bdead7e16478a108d7907.tar.gz
Fixed bug #72177 (Scope issue in __destruct after ReflectionProperty::setValue())
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r--Zend/zend_objects.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 53d215d27e..b5f19b3045 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -91,7 +91,9 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
if (destructor) {
zend_object *old_exception;
zval obj;
+ zend_class_entry *orig_fake_scope = NULL;
+ EG(fake_scope) = NULL;
if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
@@ -104,12 +106,14 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
"Call to private %s::__destruct() from context '%s'",
ZSTR_VAL(object->ce->name),
scope ? ZSTR_VAL(scope->name) : "");
+ EG(fake_scope) = orig_fake_scope;
return;
}
} else {
zend_error(E_WARNING,
"Call to private %s::__destruct() from context '' during shutdown ignored",
ZSTR_VAL(object->ce->name));
+ EG(fake_scope) = orig_fake_scope;
return;
}
} else {
@@ -123,12 +127,14 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
"Call to protected %s::__destruct() from context '%s'",
ZSTR_VAL(object->ce->name),
scope ? ZSTR_VAL(scope->name) : "");
+ EG(fake_scope) = orig_fake_scope;
return;
}
} else {
zend_error(E_WARNING,
"Call to protected %s::__destruct() from context '' during shutdown ignored",
ZSTR_VAL(object->ce->name));
+ EG(fake_scope) = orig_fake_scope;
return;
}
}
@@ -159,6 +165,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object)
}
}
zval_ptr_dtor(&obj);
+ EG(fake_scope) = orig_fake_scope;
}
}