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

From: Date: Fri, 02 Sep 2005 07:46:40 +0000
Subject: cvs: ZendEngine2(PHP_5_0) / 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-4097@lists.php.net to get a copy of this message
dmitry Fri Sep 2 03:46:40 2005 EDT Added files: (Branch: PHP_5_0) /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.1760.2.472&r2=1.1760.2.473&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.472 php-src/NEWS:1.1760.2.473 --- php-src/NEWS:1.1760.2.472 Thu Sep 1 09:21:55 2005 +++ php-src/NEWS Fri Sep 2 03:46:38 2005 @@ -27,6 +27,8 @@ classes). (Marcus) - 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 #34078 (Reflection API problems in methods with boolean or http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.287.2.24&r2=1.287.2.25&ty=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.287.2.24 ZendEngine2/zend_execute_API.c:1.287.2.25 --- ZendEngine2/zend_execute_API.c:1.287.2.24 Tue Aug 2 13:01:33 2005 +++ ZendEngine2/zend_execute_API.c Fri Sep 2 03:46:39 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute_API.c,v 1.287.2.24 2005/08/02 17:01:33 dmitry Exp $ */ +/* $Id: zend_execute_API.c,v 1.287.2.25 2005/09/02 07:46:39 dmitry Exp $ */ #include <stdio.h> #include <signal.h> @@ -743,7 +743,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 (#4097) next »