From: Dmitry Stogov Date: Fri, 2 Sep 2005 07:46:30 +0000 (+0000) Subject: Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) X-Git-Tag: PRE_NEW_OCI8_EXTENSION~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59d2e3f3aa51cc234a2bc54b7457dbeffbdb0386;p=php Fixed bug #34260 (Segfault with callbacks (array_map) + overloading) --- diff --git a/NEWS b/NEWS index 43abd52d58..418dade928 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,8 @@ PHP NEWS (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). diff --git a/Zend/tests/bug34260.phpt b/Zend/tests/bug34260.phpt new file mode 100755 index 0000000000..fa393d065c --- /dev/null +++ b/Zend/tests/bug34260.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #34260 (Segfault with callbacks (array_map) + overloading) +--FILE-- + +--EXPECT-- +I hate me +I hate me +I heart me +I heart me diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 233dbfe3c0..a83769ad62 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -807,7 +807,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS 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;