mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
- Fixed bug #55705 (Omitting a callable typehinted argument causes a segfault)
patch by: laruence@php
This commit is contained in:
parent
ad9c9ed529
commit
0ebd2309b1
9
Zend/tests/bug55705.phpt
Normal file
9
Zend/tests/bug55705.phpt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #55705 (Omitting a callable typehinted argument causes a segfault)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function f(callable $c) {}
|
||||||
|
f();
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Catchable fatal error: Argument 1 passed to f() must be callable, none given, called in %s on line 3 and defined in %s on line %d
|
@ -639,6 +639,9 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IS_CALLABLE:
|
case IS_CALLABLE:
|
||||||
|
if (!arg) {
|
||||||
|
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC);
|
||||||
|
}
|
||||||
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
|
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
|
||||||
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
|
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user