summaryrefslogtreecommitdiff
path: root/ext/spl
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-11-27 19:01:23 +0000
committerDmitry Stogov <dmitry@php.net>2008-11-27 19:01:23 +0000
commit7d4fd3fd380a7fe9b497684775a38190786b93ba (patch)
tree0ff7829b47dc4969052284b9ad9411c465bd424e /ext/spl
parentd741138a4639adb14cb31ea519ded0e0432c9e9a (diff)
downloadphp-git-7d4fd3fd380a7fe9b497684775a38190786b93ba.tar.gz
Fixed bug #46409 (__invoke method called outside of object context when using array_map)
Diffstat (limited to 'ext/spl')
-rwxr-xr-xext/spl/php_spl.c16
-rwxr-xr-xext/spl/spl_directory.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 36f1f49296..26794e4732 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -424,7 +424,7 @@ PHP_FUNCTION(spl_autoload_register)
zend_bool prepend = 0;
zend_function *spl_func_ptr;
autoload_func_info alfi;
- zval **obj_ptr;
+ zval *obj_ptr;
zend_fcall_info_cache fcc;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "|zbb", &zcallable, &do_throw, &prepend) == FAILURE) {
@@ -446,7 +446,7 @@ PHP_FUNCTION(spl_autoload_register)
if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &func_name_len, &fcc, &error TSRMLS_CC)) {
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
- obj_ptr = fcc.object_pp;
+ obj_ptr = fcc.object_ptr;
if (Z_TYPE_P(zcallable) == IS_ARRAY) {
if (!obj_ptr && alfi.func_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
if (do_throw) {
@@ -488,7 +488,7 @@ PHP_FUNCTION(spl_autoload_register)
}
alfi.ce = fcc.calling_scope;
alfi.func_ptr = fcc.function_handler;
- obj_ptr = fcc.object_pp;
+ obj_ptr = fcc.object_ptr;
if (error) {
efree(error);
}
@@ -503,10 +503,10 @@ PHP_FUNCTION(spl_autoload_register)
if (obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) {
/* add object id to the hash to ensure uniqueness, for more reference look at bug #40091 */
- memcpy(lc_name + func_name_len, &Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
+ memcpy(lc_name + func_name_len, &Z_OBJ_HANDLE_P(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
lc_name[func_name_len] = '\0';
- alfi.obj = *obj_ptr;
+ alfi.obj = obj_ptr;
Z_ADDREF_P(alfi.obj);
} else {
alfi.obj = NULL;
@@ -558,7 +558,7 @@ PHP_FUNCTION(spl_autoload_unregister)
zval *zcallable;
int success = FAILURE;
zend_function *spl_func_ptr;
- zval **obj_ptr;
+ zval *obj_ptr;
zend_fcall_info_cache fcc;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zcallable) == FAILURE) {
@@ -575,7 +575,7 @@ PHP_FUNCTION(spl_autoload_unregister)
}
RETURN_FALSE;
}
- obj_ptr = fcc.object_pp;
+ obj_ptr = fcc.object_ptr;
if (error) {
efree(error);
}
@@ -595,7 +595,7 @@ PHP_FUNCTION(spl_autoload_unregister)
success = zend_hash_del(SPL_G(autoload_functions), func_name, func_name_len+1);
if (success != SUCCESS && obj_ptr) {
func_name = erealloc(func_name, func_name_len + 1 + sizeof(zend_object_handle));
- memcpy(func_name + func_name_len, &Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
+ memcpy(func_name + func_name_len, &Z_OBJ_HANDLE_P(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
func_name[func_name_len] = '\0';
success = zend_hash_del(SPL_G(autoload_functions), func_name, func_name_len+1);
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 30daea7337..44921de279 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1805,7 +1805,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
- fci.object_pp = NULL;
+ fci.object_ptr = NULL;
fci.function_name = &z_fname;
fci.retval_ptr_ptr = &retval;
fci.param_count = num_args;
@@ -1817,7 +1817,7 @@ static int spl_filesystem_file_call(spl_filesystem_object *intern, zend_function
fcic.function_handler = func_ptr;
fcic.calling_scope = NULL;
fcic.called_scope = NULL;
- fcic.object_pp = NULL;
+ fcic.object_ptr = NULL;
result = zend_call_function(&fci, &fcic TSRMLS_CC);