Pass the executor globals to internal functions

This commit is contained in:
Zeev Suraski 2000-02-05 15:40:05 +00:00
parent 3a816341f9
commit f207b3623e
4 changed files with 5 additions and 13 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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--;
}

View File

@ -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);