Commit:    4af92aca872d7463b671c037f9d3b782e22a7c9c
Author:    Felipe Pena <felipe...@gmail.com>         Fri, 22 Jun 2012 12:05:55 
-0300
Parents:   af516750ff32f69c1df10155fa8ec0c9cc5b70ff 
b8e946b02eac53f46cbfc8eefb5c91fb5b075c9d
Branches:  PHP-5.4 master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=4af92aca872d7463b671c037f9d3b782e22a7c9c

Log:
Merge branch 'PHP-5.3' into PHP-5.4

* PHP-5.3:
  - Fixed bug #62384 (Attempting to invoke a Closure more than once causes 
segfaul)

Bugs:
https://bugs.php.net/62384

Changed paths:
  MM  ext/reflection/php_reflection.c


Diff:
diff --cc ext/reflection/php_reflection.c
index 9346587,966c9a5..ab5b15c
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -2923,9 -2747,19 +2923,19 @@@ ZEND_METHOD(reflection_method, invokeAr
        fcc.calling_scope = obj_ce;
        fcc.called_scope = intern->ce;
        fcc.object_ptr = object;
+       
+       /* 
+        * Closure::__invoke() actually expects a copy of zend_function, so 
that it
+        * frees it after the invoking.
+        */
+       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) {
+               fcc.function_handler = _copy_function(mptr TSRMLS_CC);
+       }
  
        result = zend_call_function(&fci, &fcc TSRMLS_CC);
 -      
 +
        efree(params);
  
        if (result == FAILURE) {


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to