com php-src: Fix abort too early: Zend/zend_inheritance.c

From: Date: Sun, 05 Jun 2016 07:01:01 +0000
Subject: com php-src: Fix abort too early: Zend/zend_inheritance.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92757@lists.php.net to get a copy of this message
Commit: cf0290c27380e17d2407828c974882d39ed976f4 Author: Aaron Piotrowski <aaron@trowski.com> Sun, 5 Jun 2016 02:01:01 -0500 Parents: c2266c382acf8a16c18bd7df013fe40348cd478d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf0290c27380e17d2407828c974882d39ed976f4 Log: Fix abort too early Changed paths: M Zend/zend_inheritance.c Diff: diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index dd1442e..1785f45 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -178,6 +178,8 @@ static zend_bool zend_iterable_type_check(zend_arg_info *arg_info) /* {{{ */ if (ce && instanceof_function(ce, zend_ce_traversable)) { return 1; } + + return 0; } if (arg_info->type_hint == IS_ITERABLE || arg_info->type_hint == IS_ARRAY) { @@ -336,11 +338,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c proto_arg_info = &proto->common.arg_info[proto->common.num_args]; } - if (fe_arg_info->type_hint == IS_ITERABLE && zend_iterable_type_check(proto_arg_info)) { - continue; - } - - if (!zend_do_perform_type_hint_check(fe, fe_arg_info, proto, proto_arg_info)) { + if (fe_arg_info->type_hint == IS_ITERABLE) { + if (!zend_iterable_type_check(proto_arg_info)) { + return 0; + } + } else if (!zend_do_perform_type_hint_check(fe, fe_arg_info, proto, proto_arg_info)) { return 0; } @@ -364,11 +366,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c return 0; } - if (proto->common.arg_info[-1].type_hint == IS_ITERABLE && zend_iterable_type_check(fe->common.arg_info - 1)) { - return 1; - } - - if (!zend_do_perform_type_hint_check(fe, fe->common.arg_info - 1, proto, proto->common.arg_info - 1)) { + if (proto->common.arg_info[-1].type_hint == IS_ITERABLE) { + if (!zend_iterable_type_check(fe->common.arg_info - 1)) { + return 0; + } + } else if (!zend_do_perform_type_hint_check(fe, fe->common.arg_info - 1, proto, proto->common.arg_info - 1)) { return 0; }

« previous php.cvs (#92757) next »