Remove zend_check_private()

This commit is contained in:
Dmitry Stogov 2018-09-13 13:47:06 +03:00
parent 50b515f1a2
commit 49b92446d7
3 changed files with 3 additions and 32 deletions

View File

@ -4,6 +4,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
a. php_sys_symlink() and php_sys_link()
b. zend_lookup_class_ex() and zend_fetch_class_by_name()
c. Function/property/class flags
d. Removed zend_check_private()
2. Build system changes
a. Unix build system changes
@ -35,6 +36,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES
check property_info->ce (in the same way as with methods).
- ZEND_ACC_... flags are re-numbered.
d. zend_check_private() is removed. Use (func->common.scope == scope) instead.
========================
2. Build system changes
========================

View File

@ -1102,36 +1102,6 @@ static zend_never_inline zend_function *zend_get_parent_private_method(zend_clas
}
/* }}} */
/* Ensures that we're allowed to call a private method.
* Returns the function address that should be called, or NULL
* if no such function exists.
*/
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name) /* {{{ */
{
zend_class_entry *scope;
if (!ce) {
return 0;
}
/* We may call a private function if:
* 1. The class of our object is the same as the scope, and the private
* function (EX(fbc)) has the same scope.
* 2. One of our parent classes are the same as the scope, and it contains
* a private function with the same name that has the same scope.
*/
scope = zend_get_executed_scope();
if (fbc->common.scope == scope) {
/* rule #1 checks out ok, allow the function call */
return 1;
}
/* Check rule #2 */
return zend_get_parent_private_method(scope, ce, function_name) != NULL;
}
/* }}} */
/* Ensures that we're allowed to call a protected method.
*/
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope) /* {{{ */

View File

@ -199,8 +199,6 @@ ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
ZEND_API int zend_std_get_closure(zval *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr);
ZEND_API void rebuild_object_properties(zend_object *zobj);
ZEND_API int zend_check_private(zend_function *fbc, zend_class_entry *ce, zend_string *function_name);
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name);