ZEND_API zend_executor_globals executor_globals;
#endif
+static void zend_push_function_call_entry(zend_function *fbc TSRMLS_DC) /* {{{ */
+{
+ zend_function_call_entry fcall = { fbc };
+ zend_stack_push(&CG(function_call_stack), &fcall, sizeof(zend_function_call_entry));
+}
+/* }}} */
+
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
{
property_info->name = str_estrndup(property_info->name, property_info->name_length);
efree(Z_STRVAL(function_name->u.constant));
Z_STRVAL(function_name->u.constant) = lcname;
- zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *));
+ zend_push_function_call_entry(function TSRMLS_CC);
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls + 1;
}
{
zend_op *last_op;
int last_op_number;
- unsigned char *ptr = NULL;
zend_do_end_variable_parse(left_bracket, BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
}
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRMLS_DC) /* {{{ */
{
- unsigned char *ptr = NULL;
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
}
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
{
znode class_node;
- unsigned char *ptr = NULL;
zend_op *opline;
if (method_name->op_type == IS_CONST) {
SET_NODE(opline->op2, method_name);
}
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
}
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
} else {
- zend_function **function_ptr_ptr;
- zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
+ zend_function_call_entry *fcall;
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- if (*function_ptr_ptr) {
+ if (fcall->fbc) {
opline->opcode = ZEND_DO_FCALL;
SET_NODE(opline->op1, function_name);
SET_UNUSED(opline->op2);
{
zend_op *opline;
int original_op = op;
- zend_function **function_ptr_ptr, *function_ptr;
+ zend_function_call_entry *fcall;
+ zend_function *function_ptr;
int send_by_reference = 0;
int send_function = 0;
- zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
- function_ptr = *function_ptr_ptr;
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
+ function_ptr = fcall->fbc;
if (original_op == ZEND_SEND_REF) {
if (function_ptr &&
void zend_do_unpack_params(znode *params, int offset TSRMLS_DC) /* {{{ */
{
zend_op *opline;
- zend_function **function_ptr_ptr;
+ zend_function_call_entry *fcall;
- zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
- if (*function_ptr_ptr) {
+ zend_stack_top(&CG(function_call_stack), (void **) &fcall);
+ if (fcall->fbc) {
/* If argument unpacking is used argument numbers and sending modes can no longer be
* computed at compile time, thus we need access to EX(call). In order to have it we
* retroactively emit a ZEND_INIT_FCALL_BY_NAME opcode. */
zval func_name;
- ZVAL_STRING(&func_name, (*function_ptr_ptr)->common.function_name, 1);
+ ZVAL_STRING(&func_name, fcall->fbc->common.function_name, 1);
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
GET_CACHE_SLOT(opline->op2.constant);
++CG(context).nested_calls;
- *function_ptr_ptr = NULL;
+ fcall->fbc = NULL;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /* {{{ */
{
zend_op *opline;
- unsigned char *ptr = NULL;
new_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
SET_NODE(opline->op1, class_type);
SET_UNUSED(opline->op2);
- zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
+ zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}