com php-src: - Improved fix for #62384: ext/reflection/php_re flection.c
| From: | Felipe Pena | Date: | Sat, 23 Jun 2012 18:10:47 +0000 |
| Subject: | com php-src: - Improved fix for #62384: ext/reflection/php_re flection.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69440@lists.php.net to get a copy of this message | ||
Commit: c3f34796a053f5ff1016d872f8c339e32468783f
Author: Felipe Pena <felipensp@gmail.com> Sat, 23 Jun 2012 15:10:47 -0300
Parents: 84b1c568f4d593c2f415b05f3b1b8bd0465eec27
Branches: PHP-5.3 PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c3f34796a053f5ff1016d872f8c339e32468783f
Log:
- Improved fix for #62384
Bugs:
https://bugs.php.net/62384
Changed paths:
M ext/reflection/php_reflection.c
Diff:
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 966c9a5..180ce8f 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2749,12 +2749,10 @@ ZEND_METHOD(reflection_method, invokeArgs)
fcc.object_ptr = object;
/*
- * Closure::__invoke() actually expects a copy of zend_function, so that it
- * frees it after the invoking.
+ * Copy the zend_function when calling via handler (e.g. Closure::__invoke())
*/
- if (obj_ce == zend_ce_closure && object &&
- strlen(mptr->common.function_name) == sizeof(ZEND_INVOKE_FUNC_NAME)-1 &&
- memcmp(mptr->common.function_name, ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) ==
0) {
+ if (mptr->type == ZEND_INTERNAL_FUNCTION &&
+ (mptr->internal_function.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) {
fcc.function_handler = _copy_function(mptr TSRMLS_CC);
}