| Dmitry Stogov 2005-09-02, 3:55 am |
| 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...&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 w number).
http://cvs.php.net/diff.php/ZendEng...9&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_st
ate).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/ZendEngin....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
|