1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00

Require all internal functions to have arginfo

This commit is contained in:
Nikita Popov
2020-02-13 16:38:51 +01:00
parent 8d30d5f269
commit b35b0142e6
3 changed files with 9 additions and 9 deletions
+4
View File
@@ -13,6 +13,7 @@ PHP 8.0 INTERNALS UPGRADE NOTES
j. compare_objects() and compare() object handlers
k. The 'I' length modifier
l. Some VM instructions switched to IS_TMP_VAR result instead of IS_VAR
m. All internal functions must have arginfo
2. Build system changes
a. Abstract
@@ -98,6 +99,9 @@ PHP 8.0 INTERNALS UPGRADE NOTES
pre increments/decrements (ZEND_PRE_INC, ZEND_PRE_DEC, ZEND_PRE_INC_OBJ
ZEND_PRE_DEC_OBJ, ZEND_PRE_INC_STATIC_PROP ZEND_PRE_DEC_STATIC_PROP).
m. All internal functions and methods are now required to specify arginfo
information, otherwise warnings will be thrown on startup.
========================
2. Build system changes
========================
+5 -1
View File
@@ -2042,9 +2042,9 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
} else {
internal_function->fn_flags = ZEND_ACC_PUBLIC;
}
if (ptr->arg_info) {
zend_internal_function_info *info = (zend_internal_function_info*)ptr->arg_info;
internal_function->arg_info = (zend_internal_arg_info*)ptr->arg_info+1;
internal_function->num_args = ptr->num_args;
/* Currently you cannot denote that the function can accept less arguments than num_args */
@@ -2072,10 +2072,14 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
internal_function->fn_flags |= ZEND_ACC_HAS_RETURN_TYPE;
}
} else {
zend_error(E_CORE_WARNING, "Missing arginfo for %s%s%s()",
scope ? ZSTR_VAL(scope->name) : "", scope ? "::" : "", ptr->fname);
internal_function->arg_info = NULL;
internal_function->num_args = 0;
internal_function->required_num_args = 0;
}
zend_set_function_arg_flags((zend_function*)internal_function);
if (ptr->flags & ZEND_ACC_ABSTRACT) {
if (scope) {
-8
View File
@@ -530,14 +530,6 @@ static inheritance_status zend_do_perform_implementation_check(
inheritance_status status, local_status;
zend_bool proto_is_variadic, fe_is_variadic;
/* If it's a user function then arg_info == NULL means we don't have any parameters but
* we still need to do the arg number checks. We are only willing to ignore this for internal
* functions because extensions don't always define arg_info.
*/
if (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION) {
return INHERITANCE_SUCCESS;
}
/* Checks for constructors only if they are declared in an interface,
* or explicitly marked as abstract
*/