com php-src: Fix handling of void return type on internal functions: Zend/zend_execute.c

From: Date: Sat, 30 Jun 2018 18:10:57 +0000
Subject: com php-src: Fix handling of void return type on internal functions: Zend/zend_execute.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-102345@lists.php.net to get a copy of this message
Commit: 9b0df97a42749464069859c5ca77c0241a8b05ca Author: Nikita Popov <nikita.ppv@gmail.com> Sat, 30 Jun 2018 20:10:57 +0200 Parents: 2eb6a541a9d4141dcad427799cf8acbeba3f2777 Branches: PHP-7.1 PHP-7.2 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9b0df97a42749464069859c5ca77c0241a8b05ca Log: Fix handling of void return type on internal functions Changed paths: M Zend/zend_execute.c Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f88fac6..60953ee 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1042,9 +1042,12 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret) zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1; zend_class_entry *ce = NULL; - if (UNEXPECTED(ret_info->type_hint == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) { - zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); - return 0; + if (ret_info->type_hint == IS_VOID) { + if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) { + zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); + return 0; + } + return 1; } if (UNEXPECTED(!zend_check_internal_type(zf, ret_info, ret, &ce, 1))) {

« previous php.cvs (#102345) next »