cvs: ZendEngine2 / zend_execute_API.c /tests bug34260.phpt php-src NEWS

From: Date: Fri, 02 Sep 2005 07:46:31 +0000
Subject: cvs: ZendEngine2 / zend_execute_API.c /tests bug34260.phpt php-src NEWS
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4096@lists.php.net to get a copy of this message
dmitry Fri Sep 2 03:46:31 2005 EDT Added files: /ZendEngine2/tests bug34260.phpt Modified files: /php-src NEWS /ZendEngine2 zend_execute_API.c Log: Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2056&r2=1.2057&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2056 php-src/NEWS:1.2057 --- php-src/NEWS:1.2056 Thu Sep 1 09:20:57 2005 +++ php-src/NEWS Fri Sep 2 03:46:28 2005 @@ -22,6 +22,8 @@ (Derick) - Fixed bug #34277 (array_filter() crashes with references and objects). (Dmitry) +- Fixed bug #34260 (Segfault with callbacks (array_map) + overloading). + (Dmitry) - Fixed bug #34137 (assigning array element by reference causes binary mess). (Dmitry) - Fixed bug #33957 (gmdate('W')/date('W') sometimes returns wrong week number). http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.339&r2=1.340&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.339 ZendEngine2/zend_execute_API.c:1.340 --- ZendEngine2/zend_execute_API.c:1.339 Tue Aug 23 03:23:30 2005 +++ ZendEngine2/zend_execute_API.c Fri Sep 2 03:46:30 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.339 2005/08/23 07:23:30 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.340 2005/09/02 07:46:30 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -807,7 +807,9 @@ return FAILURE; } } - if (fci_cache) { + if (fci_cache && + (EX(function_state).function->type != ZEND_INTERNAL_FUNCTION || + ((zend_internal_function*)EX(function_state).function)->handler != zend_std_call_user_call)) { fci_cache->function_handler = EX(function_state).function; fci_cache->object_pp = fci->object_pp; fci_cache->calling_scope = calling_scope; http://cvs.php.net/co.php/ZendEngine2/tests/bug34260.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug34260.phpt +++ ZendEngine2/tests/bug34260.phpt --TEST-- Bug #34260 (Segfault with callbacks (array_map) + overloading) --FILE-- <?php class Faulty { function __call($Method,$Args) { switch($Method) { case 'seg': echo "I hate me\n"; break; } } function NormalMethod($Args) { echo "I heart me\n"; } } $Faulty = new Faulty(); $Array = array('Some junk','Some other junk'); // This causes a seg fault. $Failure = array_map(array($Faulty,'seg'),$Array); // This does not. $Failure = array_map(array($Faulty,'NormalMethod'),$Array); ?> --EXPECT-- I hate me I hate me I heart me I heart me

« previous php.zend-engine.cvs (#4096) next »