diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-10-27 13:12:45 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-10-28 16:18:15 +0100 |
commit | b897d19552d195b5cad9d74f9c4c2d3504e68a89 (patch) | |
tree | 700185337a14b918b8ba0f2d7d72533fd8d8f611 /ext/reflection/php_reflection.c | |
parent | 87fefd165a29091c3cb462431529107189c12d55 (diff) | |
download | php-git-b897d19552d195b5cad9d74f9c4c2d3504e68a89.tar.gz |
Add missing zend_parse_parameters_none()
We fix the trivial cases; some others need further discussion, see
<https://news-web.php.net/php.internals/107723>.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9f60fc8f74..720706d9d5 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1649,6 +1649,11 @@ ZEND_METHOD(reflection_function, isDisabled) zend_function *fptr; GET_REFLECTION_OBJECT_PTR(fptr); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION && fptr->internal_function.handler == zif_display_disabled_function); } /* }}} */ @@ -1890,6 +1895,10 @@ ZEND_METHOD(reflection_function, returnsReference) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_BOOL((fptr->op_array.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0); } /* }}} */ @@ -1904,6 +1913,10 @@ ZEND_METHOD(reflection_function, getNumberOfParameters) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { num_args++; @@ -1922,6 +1935,10 @@ ZEND_METHOD(reflection_function, getNumberOfRequiredParameters) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_LONG(fptr->common.required_num_args); } /* }}} */ @@ -1937,6 +1954,10 @@ ZEND_METHOD(reflection_function, getParameters) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + arg_info= fptr->common.arg_info; num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { @@ -1976,6 +1997,10 @@ ZEND_METHOD(reflection_function, getExtension) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (fptr->type != ZEND_INTERNAL_FUNCTION) { RETURN_NULL(); } @@ -1999,6 +2024,10 @@ ZEND_METHOD(reflection_function, getExtensionName) GET_REFLECTION_OBJECT_PTR(fptr); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (fptr->type != ZEND_INTERNAL_FUNCTION) { RETURN_FALSE; } @@ -4643,6 +4672,10 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor) GET_REFLECTION_OBJECT_PTR(ce); + if (zend_parse_parameters_none() == FAILURE) { + return; + } + if (ce->type == ZEND_INTERNAL_CLASS && ce->create_object != NULL && (ce->ce_flags & ZEND_ACC_FINAL)) { zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ZSTR_VAL(ce->name)); |