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

From: Date: Fri, 02 Sep 2005 07:47:28 +0000
Subject: cvs: ZendEngine2(PHP_5_1) / 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-4098@lists.php.net to get a copy of this message
dmitry Fri Sep 2 03:47:28 2005 EDT Added files: (Branch: PHP_5_1) /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.2027.2.45&r2=1.2027.2.46&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.45 php-src/NEWS:1.2027.2.46 --- php-src/NEWS:1.2027.2.45 Thu Sep 1 15:15:17 2005 +++ php-src/NEWS Fri Sep 2 03:47:25 2005 @@ -30,6 +30,8 @@ - Fixed bug #34277 (array_filter() crashes with references and objects). (Dmitry) - Fixed bug #34276 (setAttributeNS doesn't work with default namespace). (Rob) +- Fixed bug #34260 (Segfault with callbacks (array_map) + overloading). + (Dmitry) - Fixed bug #34257 (lib64 not handled correctly in ming extension). (Marcus) - Fixed bug #34221 (Compiling xmlrpc as shared fails other parts). (Jani) - Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). (Ilia) http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.331&r2=1.331.2.1&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.331 ZendEngine2/zend_execute_API.c:1.331.2.1 --- ZendEngine2/zend_execute_API.c:1.331 Wed Aug 3 09:30:52 2005 +++ ZendEngine2/zend_execute_API.c Fri Sep 2 03:47:27 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.331 2005/08/03 13:30:52 sniper Exp $ */ +/* $Id: zend_execute_API.c,v 1.331.2.1 2005/09/02 07:47:27 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -750,7 +750,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 (#4098) next »