com php-src: Merge branch 'PHP-5.6': Zend/zend_closures.c
| From: | Nikita Popov | Date: | Fri, 29 May 2015 09:11:02 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6': Zend/zend_closures.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86989@lists.php.net to get a copy of this message | ||
Commit: 39753fa222b42d806bb622bac22e27b4381ff099
Author: Nikita Popov <nikic@php.net> Fri, 29 May 2015 11:11:02 +0200
Parents: 402f697068ee10155497d28a32d3e8e955f5fec2 e7d0ca39e5030226d3c237a481b1c50d8a2db2f3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=39753fa222b42d806bb622bac22e27b4381ff099
Log:
Merge branch 'PHP-5.6'
Preserving HAS_RETURN_TYPE for __invoke() here as well.
Conflicts:
Zend/zend_alloc.c
Changed paths:
MM Zend/zend_closures.c
Diff:
diff --cc Zend/zend_closures.c
index e656f8d,90d7eaf..2eeaec6
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@@ -199,18 -144,16 +199,21 @@@ static int zend_closure_compare_objects
}
/* }}} */
-ZEND_API zend_function *zend_get_closure_invoke_method(zval *obj TSRMLS_DC) /* {{{ */
+ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *object) /* {{{ */
{
- zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
+ zend_closure *closure = (zend_closure *)object;
zend_function *invoke = (zend_function*)emalloc(sizeof(zend_function));
- const zend_uint keep_flags = ZEND_ACC_RETURN_REFERENCE | ZEND_ACC_VARIADIC;
++ const uint32_t keep_flags =
++ ZEND_ACC_RETURN_REFERENCE | ZEND_ACC_VARIADIC | ZEND_ACC_HAS_RETURN_TYPE;
invoke->common = closure->func.common;
+ /* We return ZEND_INTERNAL_FUNCTION, but arg_info representation is the
+ * same as for ZEND_USER_FUNCTION (uses zend_string* instead of char*).
+ * This is not a problem, because ZEND_ACC_HAS_TYPE_HINTS is never set,
+ * and we won't check arguments on internal function */
invoke->type = ZEND_INTERNAL_FUNCTION;
- invoke->internal_function.fn_flags = ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER |
(closure->func.common.fn_flags & ZEND_ACC_RETURN_REFERENCE);
+ invoke->internal_function.fn_flags =
+ ZEND_ACC_PUBLIC | ZEND_ACC_CALL_VIA_HANDLER | (closure->func.common.fn_flags &
keep_flags);
invoke->internal_function.handler = ZEND_MN(Closure___invoke);
invoke->internal_function.module = 0;
invoke->internal_function.scope = zend_ce_closure;