diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-13 16:38:51 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-26 10:05:20 +0100 |
commit | b35b0142e68458475df03c24e622f1c4173ff68b (patch) | |
tree | e765dfdfde4fe27698789885ebf0f9e7df33a51e /Zend/zend_API.c | |
parent | 8d30d5f26944f98ef370cc09a638461510e9ad2b (diff) | |
download | php-git-b35b0142e68458475df03c24e622f1c4173ff68b.tar.gz |
Require all internal functions to have arginfo
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 595208033b..a739303cf3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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) { |