|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespatch_closures_rebind (last revision 2010-08-08 14:30 UTC by cataphract@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-06 03:53 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: dmitry
[2010-08-08 16:30 UTC] cataphract@php.net
[2010-08-08 17:06 UTC] felipe@php.net
[2010-08-08 17:06 UTC] felipe@php.net
-Status: Assigned
+Status: Closed
[2010-08-08 17:06 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 01:00:01 2025 UTC |
Description: ------------ Calling a function in a rebound closure causes a crash. This seems to be caused by dmitry's optimizations because this fixes the issue: #define CACHED_PTR(num) 0. Test script: --------------- class foo { static function getClosure() { return static function () { //causes a crash (fbc not properly defined) in call after rebinding echo get_called_class(), "\n"; }; } } class subFoo { } $c = foo::getClosure(); $c(); //foo $c = $c->bindTo(new subFoo()); $c(); //crash Expected result: ---------------- No crash. Actual result: -------------- > php5ts_debug.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data * execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8) Line 302 + 0x3 bytes C php5ts_debug.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data * execute_data=0x025d2298, void * * * tsrm_ls=0x02784bf8) Line 1721 C php5ts_debug.dll!execute(_zend_op_array * op_array=0x025f23c8, void * * * tsrm_ls=0x02784bf8) Line 136 + 0x11 bytes C php5ts_debug.dll!zend_execute_scripts(int type=8, void * * * tsrm_ls=0x02784bf8, _zval_struct * * retval=0x00000000, int file_count=3, ...) Line 1193 + 0x21 bytes C php5ts_debug.dll!php_execute_script(_zend_file_handle * primary_file=0x00aaf7b0, void * * * tsrm_ls=0x02784bf8) Line 2330 + 0x1b bytes C php.exe!main(int argc=2, char * * argv=0x02784af8) Line 1252 + 0x13 bytes C