From f207b3623e61da6a25e671fbcef70de49133b714 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sat, 5 Feb 2000 15:40:05 +0000 Subject: [PATCH] Pass the executor globals to internal functions --- Zend/zend.h | 4 ++-- Zend/zend_builtin_functions.c | 8 -------- Zend/zend_execute.c | 4 ++-- Zend/zend_execute_API.c | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Zend/zend.h b/Zend/zend.h index d1035857f87..94e9cc0f7f7 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -117,8 +117,8 @@ typedef unsigned char zend_bool; #include "zend_hash.h" #include "zend_llist.h" -#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval *this_ptr, int return_value_used -#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, this_ptr, return_value_used +#define INTERNAL_FUNCTION_PARAMETERS int ht, zval *return_value, zval *this_ptr, int return_value_used ELS_DC +#define INTERNAL_FUNCTION_PARAM_PASSTHRU ht, return_value, this_ptr, return_value_used ELS_CC /* * zval diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index b828a8bd7f9..15a875e0e52 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -89,7 +89,6 @@ ZEND_FUNCTION(func_num_args) { void **p; int arg_count; - ELS_FETCH(); p = EG(argument_stack).top_element-1; arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */ @@ -111,7 +110,6 @@ ZEND_FUNCTION(func_get_arg) zval **z_requested_offset; zval *arg; long requested_offset; - ELS_FETCH(); if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &z_requested_offset)==FAILURE) { RETURN_FALSE; @@ -145,7 +143,6 @@ ZEND_FUNCTION(func_get_args) void **p; int arg_count; int i; - ELS_FETCH(); p = EG(argument_stack).top_element-1; arg_count = (ulong) *p; /* this is the amount of arguments passed to func_num_args(); */ @@ -269,7 +266,6 @@ ZEND_FUNCTION(error_reporting) { zval **arg; int old_error_reporting; - ELS_FETCH(); old_error_reporting = EG(error_reporting); switch (ZEND_NUM_ARGS()) { @@ -295,7 +291,6 @@ ZEND_FUNCTION(define) zval **var, **val, **non_cs; int case_sensitive; zend_constant c; - ELS_FETCH(); switch(ZEND_NUM_ARGS()) { case 2: @@ -486,7 +481,6 @@ ZEND_FUNCTION(function_exists) zval **function_name; char *lcname; int retval; - ELS_FETCH(); if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) { WRONG_PARAM_COUNT; @@ -549,8 +543,6 @@ ZEND_FUNCTION(get_used_files) ZEND_FUNCTION(get_imported_files) { - ELS_FETCH(); - array_init(return_value); zend_hash_apply_with_argument(&EG(imported_files), (int (*)(void *, void *)) copy_import_use_file, return_value); } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 10468da0e1a..86f55486142 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -930,7 +930,7 @@ static void call_overloaded_function(int arg_count, zval *return_value, HashTabl zend_property_reference *property_reference; zend_stack_top(&EG(overloaded_objects_stack), (void **) &property_reference); - (property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, property_reference->object, 1, property_reference); + (property_reference->object)->value.obj.ce->handle_function_call(arg_count, return_value, property_reference->object, 1 ELS_CC, property_reference); zend_llist_destroy(&property_reference->elements_list); zend_stack_del_top(&EG(overloaded_objects_stack)); @@ -1534,7 +1534,7 @@ do_fcall_common: if (function_state.function->type==ZEND_INTERNAL_FUNCTION) { ALLOC_ZVAL(Ts[opline->result.u.var].var.ptr); INIT_ZVAL(*(Ts[opline->result.u.var].var.ptr)); - ((zend_internal_function *) function_state.function)->handler(opline->extended_value, Ts[opline->result.u.var].var.ptr, object.ptr, return_value_used); + ((zend_internal_function *) function_state.function)->handler(opline->extended_value, Ts[opline->result.u.var].var.ptr, object.ptr, return_value_used ELS_CC); if (object.ptr) { object.ptr->refcount--; } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 877ce8082cd..b8e4aa62db3 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -415,7 +415,7 @@ int call_user_function_ex(HashTable *function_table, zval *object, zval *functio EG(opline_ptr) = original_opline_ptr; } else { ALLOC_INIT_ZVAL(*retval_ptr_ptr); - ((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1); + ((zend_internal_function *) function_state.function)->handler(param_count, *retval_ptr_ptr, object, 1 ELS_CC); INIT_PZVAL(*retval_ptr_ptr); } zend_ptr_stack_clear_multiple(ELS_C);