mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Removed EG(called_scope) and use corresponding value from EG(current_execute_data)
This commit is contained in:
parent
0a77dcd4b9
commit
c4d99ec982
14 changed files with 49 additions and 65 deletions
|
@ -2770,7 +2770,7 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
|
|||
if (!EG(scope)) {
|
||||
if (error) *error = estrdup("cannot access self:: when no class scope is active");
|
||||
} else {
|
||||
fcc->called_scope = EG(called_scope);
|
||||
fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
|
||||
fcc->calling_scope = EG(scope);
|
||||
if (!fcc->object && Z_OBJ(EG(This))) {
|
||||
fcc->object = Z_OBJ(EG(This));
|
||||
|
@ -2784,7 +2784,7 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
|
|||
} else if (!EG(scope)->parent) {
|
||||
if (error) *error = estrdup("cannot access parent:: when current class scope has no parent");
|
||||
} else {
|
||||
fcc->called_scope = EG(called_scope);
|
||||
fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
|
||||
fcc->calling_scope = EG(scope)->parent;
|
||||
if (!fcc->object && Z_OBJ(EG(This))) {
|
||||
fcc->object = Z_OBJ(EG(This));
|
||||
|
@ -2794,11 +2794,11 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
|
|||
}
|
||||
} else if (name_len == sizeof("static") - 1 &&
|
||||
!memcmp(lcname->val, "static", sizeof("static") - 1)) {
|
||||
if (!EG(called_scope)) {
|
||||
if (!EG(current_execute_data) || !EG(current_execute_data)->called_scope) {
|
||||
if (error) *error = estrdup("cannot access static:: when no class scope is active");
|
||||
} else {
|
||||
fcc->called_scope = EG(called_scope);
|
||||
fcc->calling_scope = EG(called_scope);
|
||||
fcc->called_scope = EG(current_execute_data)->called_scope;
|
||||
fcc->calling_scope = EG(current_execute_data)->called_scope;
|
||||
if (!fcc->object && Z_OBJ(EG(This))) {
|
||||
fcc->object = Z_OBJ(EG(This));
|
||||
}
|
||||
|
|
|
@ -809,8 +809,8 @@ ZEND_FUNCTION(get_called_class)
|
|||
return;
|
||||
}
|
||||
|
||||
if (EG(called_scope)) {
|
||||
RETURN_STR(STR_COPY(EG(called_scope)->name));
|
||||
if (EG(current_execute_data)->called_scope) {
|
||||
RETURN_STR(STR_COPY(EG(current_execute_data)->called_scope->name));
|
||||
} else if (!EG(scope)) {
|
||||
zend_error(E_WARNING, "get_called_class() called from outside a class");
|
||||
}
|
||||
|
|
|
@ -379,8 +379,8 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
|
|||
}
|
||||
} else if (class_name_len == sizeof("static")-1 &&
|
||||
!memcmp(lcname, "static", sizeof("static")-1)) {
|
||||
if (EG(called_scope)) {
|
||||
ce = EG(called_scope);
|
||||
if (EG(current_execute_data) && EG(current_execute_data)->called_scope) {
|
||||
ce = EG(current_execute_data)->called_scope;
|
||||
} else {
|
||||
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
|
||||
}
|
||||
|
|
|
@ -1547,7 +1547,6 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
|
|||
{
|
||||
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
|
||||
ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
|
||||
ZEND_ASSERT(EX(called_scope) == EG(called_scope));
|
||||
|
||||
EX(return_value) = return_value;
|
||||
EX(frame_kind) = frame_kind;
|
||||
|
|
|
@ -186,7 +186,6 @@ void init_executor(TSRMLS_D) /* {{{ */
|
|||
EG(prev_exception) = NULL;
|
||||
|
||||
EG(scope) = NULL;
|
||||
EG(called_scope) = NULL;
|
||||
|
||||
ZVAL_OBJ(&EG(This), NULL);
|
||||
|
||||
|
@ -662,12 +661,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
|||
zend_uint i;
|
||||
zend_array *calling_symbol_table;
|
||||
zend_class_entry *calling_scope = NULL;
|
||||
zend_class_entry *called_scope = NULL;
|
||||
zend_execute_data *call, dummy_execute_data;
|
||||
zend_fcall_info_cache fci_cache_local;
|
||||
zend_function *func;
|
||||
zend_object *orig_object;
|
||||
zend_class_entry *orig_scope, *orig_called_scope;
|
||||
zend_class_entry *orig_scope;
|
||||
zval tmp;
|
||||
|
||||
ZVAL_UNDEF(fci->retval);
|
||||
|
@ -690,7 +688,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
|||
|
||||
orig_object = Z_OBJ(EG(This));
|
||||
orig_scope = EG(scope);
|
||||
orig_called_scope = EG(called_scope);
|
||||
|
||||
/* Initialize execute_data */
|
||||
if (!EG(current_execute_data)) {
|
||||
|
@ -746,7 +743,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
|||
func = fci_cache->function_handler;
|
||||
call = zend_vm_stack_push_call_frame(func, fci->param_count, ZEND_CALL_DONE, fci_cache->called_scope, fci_cache->object, NULL TSRMLS_CC);
|
||||
calling_scope = fci_cache->calling_scope;
|
||||
called_scope = fci_cache->called_scope;
|
||||
fci->object = fci_cache->object;
|
||||
if (fci->object &&
|
||||
(!EG(objects_store).object_buckets ||
|
||||
|
@ -839,7 +835,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
|||
call->num_args = fci->param_count;
|
||||
|
||||
EG(scope) = calling_scope;
|
||||
EG(called_scope) = called_scope;
|
||||
if (!fci->object ||
|
||||
(func->common.fn_flags & ZEND_ACC_STATIC)) {
|
||||
Z_OBJ(EG(This)) = call->object = NULL;
|
||||
|
@ -942,7 +937,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
|||
|
||||
Z_OBJ(EG(This)) = orig_object;
|
||||
EG(scope) = orig_scope;
|
||||
EG(called_scope) = orig_called_scope;
|
||||
if (EG(current_execute_data) == &dummy_execute_data) {
|
||||
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
|
||||
}
|
||||
|
@ -1120,7 +1114,7 @@ ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char *s
|
|||
ZVAL_UNDEF(&local_retval);
|
||||
if (EG(current_execute_data)) {
|
||||
EG(current_execute_data)->call = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EG(current_execute_data)->called_scope, Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
}
|
||||
zend_execute(new_op_array, &local_retval TSRMLS_CC);
|
||||
} zend_catch {
|
||||
|
@ -1494,10 +1488,10 @@ check_fetch_type:
|
|||
}
|
||||
return EG(scope)->parent;
|
||||
case ZEND_FETCH_CLASS_STATIC:
|
||||
if (!EG(called_scope)) {
|
||||
if (!EG(current_execute_data) || !EG(current_execute_data)->called_scope) {
|
||||
zend_error(E_ERROR, "Cannot access static:: when no class scope is active");
|
||||
}
|
||||
return EG(called_scope);
|
||||
return EG(current_execute_data)->called_scope;
|
||||
case ZEND_FETCH_CLASS_AUTO: {
|
||||
fetch_type = zend_get_class_fetch_type(class_name->val, class_name->len);
|
||||
if (fetch_type!=ZEND_FETCH_CLASS_DEFAULT) {
|
||||
|
|
|
@ -314,7 +314,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
|
|||
zend_array *original_active_symbol_table = EG(active_symbol_table);
|
||||
zend_object *original_This;
|
||||
zend_class_entry *original_scope = EG(scope);
|
||||
zend_class_entry *original_called_scope = EG(called_scope);
|
||||
zend_vm_stack original_stack = EG(argument_stack);
|
||||
|
||||
original_This = Z_OBJ(EG(This));
|
||||
|
@ -324,7 +323,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
|
|||
EG(active_symbol_table) = generator->execute_data->symbol_table;
|
||||
Z_OBJ(EG(This)) = generator->execute_data->object;
|
||||
EG(scope) = generator->execute_data->scope;
|
||||
EG(called_scope) = generator->execute_data->called_scope;
|
||||
EG(argument_stack) = generator->stack;
|
||||
|
||||
/* We want the backtrace to look as if the generator function was
|
||||
|
@ -353,7 +351,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
|
|||
EG(active_symbol_table) = original_active_symbol_table;
|
||||
Z_OBJ(EG(This)) = original_This;
|
||||
EG(scope) = original_scope;
|
||||
EG(called_scope) = original_called_scope;
|
||||
EG(argument_stack) = original_stack;
|
||||
|
||||
/* If an exception was thrown in the generator we have to internally
|
||||
|
|
|
@ -186,7 +186,6 @@ struct _zend_executor_globals {
|
|||
HashTable *zend_constants; /* constants table */
|
||||
|
||||
zend_class_entry *scope;
|
||||
zend_class_entry *called_scope; /* Scope of the calling class */
|
||||
|
||||
zval This;
|
||||
|
||||
|
|
|
@ -90,11 +90,12 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
|
|||
if (object) {
|
||||
fcic.called_scope = Z_OBJCE_P(object);
|
||||
} else if (obj_ce &&
|
||||
!(EG(called_scope) &&
|
||||
instanceof_function(EG(called_scope), obj_ce TSRMLS_CC))) {
|
||||
!(EG(current_execute_data) &&
|
||||
EG(current_execute_data)->called_scope &&
|
||||
instanceof_function(EG(current_execute_data)->called_scope, obj_ce TSRMLS_CC))) {
|
||||
fcic.called_scope = obj_ce;
|
||||
} else {
|
||||
fcic.called_scope = EG(called_scope);
|
||||
fcic.called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
|
||||
}
|
||||
fcic.object = object ? Z_OBJ_P(object) : NULL;
|
||||
result = zend_call_function(&fci, &fcic TSRMLS_CC);
|
||||
|
|
|
@ -1808,7 +1808,6 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
|
|||
}
|
||||
Z_OBJ(EG(This)) = EX(object);
|
||||
EG(scope) = EX(scope);
|
||||
EG(called_scope) = EX(called_scope);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_op *opline = EX(opline);
|
||||
|
@ -2365,7 +2364,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
|
|||
if (OP1_TYPE != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2620,7 +2619,8 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
|
|||
#else
|
||||
EG(scope) = fbc->common.scope;
|
||||
#endif
|
||||
EG(called_scope) = call->called_scope;
|
||||
} else {
|
||||
call->called_scope = EX(called_scope);
|
||||
}
|
||||
|
||||
call->opline = NULL;
|
||||
|
@ -2681,7 +2681,6 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
|
|||
|
||||
Z_OBJ(EG(This)) = call->object;
|
||||
EG(scope) = fbc->common.scope;
|
||||
EG(called_scope) = call->called_scope;
|
||||
EG(active_symbol_table) = NULL;
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
return_value = EX_VAR(opline->result.var);
|
||||
|
@ -2716,7 +2715,6 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
|
|||
Z_OBJ(EG(This)) = call->object;
|
||||
//??? EG(scope) = NULL;
|
||||
EG(scope) = fbc->common.scope;
|
||||
EG(called_scope) = call->called_scope;
|
||||
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
|
||||
|
@ -2769,7 +2767,6 @@ ZEND_VM_C_LABEL(fcall_end_change_scope):
|
|||
}
|
||||
Z_OBJ(EG(This)) = EX(object);
|
||||
EG(scope) = EX(scope);
|
||||
EG(called_scope) = EX(called_scope);
|
||||
|
||||
ZEND_VM_C_LABEL(fcall_end):
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
|
@ -3986,7 +3983,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
|
|||
}
|
||||
|
||||
EX(call) = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
|
@ -5346,7 +5343,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
|
|||
closure_is_static = Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->call->func->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(called_scope), NULL TSRMLS_CC);
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC);
|
||||
}
|
||||
|
|
|
@ -380,7 +380,7 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC
|
|||
execute_data = EG(current_execute_data)->call;
|
||||
} else {
|
||||
execute_data = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), NULL TSRMLS_CC);
|
||||
(zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC);
|
||||
}
|
||||
EX(prev_execute_data) = EG(current_execute_data);
|
||||
i_init_execute_data(execute_data, op_array, return_value, EG(active_symbol_table) ? VM_FRAME_TOP_CODE : VM_FRAME_TOP_FUNCTION TSRMLS_CC);
|
||||
|
@ -426,7 +426,6 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
|
|||
}
|
||||
Z_OBJ(EG(This)) = EX(object);
|
||||
EG(scope) = EX(scope);
|
||||
EG(called_scope) = EX(called_scope);
|
||||
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
zend_op *opline = EX(opline);
|
||||
|
@ -567,7 +566,8 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
|||
#else
|
||||
EG(scope) = fbc->common.scope;
|
||||
#endif
|
||||
EG(called_scope) = call->called_scope;
|
||||
} else {
|
||||
call->called_scope = EX(called_scope);
|
||||
}
|
||||
|
||||
call->opline = NULL;
|
||||
|
@ -628,7 +628,6 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
|||
|
||||
Z_OBJ(EG(This)) = call->object;
|
||||
EG(scope) = fbc->common.scope;
|
||||
EG(called_scope) = call->called_scope;
|
||||
EG(active_symbol_table) = NULL;
|
||||
if (RETURN_VALUE_USED(opline)) {
|
||||
return_value = EX_VAR(opline->result.var);
|
||||
|
@ -663,7 +662,6 @@ static int ZEND_FASTCALL ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
|||
Z_OBJ(EG(This)) = call->object;
|
||||
//??? EG(scope) = NULL;
|
||||
EG(scope) = fbc->common.scope;
|
||||
EG(called_scope) = call->called_scope;
|
||||
|
||||
ZVAL_NULL(EX_VAR(opline->result.var));
|
||||
|
||||
|
@ -716,7 +714,6 @@ fcall_end_change_scope:
|
|||
}
|
||||
Z_OBJ(EG(This)) = EX(object);
|
||||
EG(scope) = EX(scope);
|
||||
EG(called_scope) = EX(called_scope);
|
||||
|
||||
fcall_end:
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
|
@ -2921,7 +2918,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
|
|||
}
|
||||
|
||||
EX(call) = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
|
@ -3804,7 +3801,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
|
|||
if (IS_CONST != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4770,7 +4767,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
|
|||
if (IS_CONST != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5604,7 +5601,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
|
|||
if (IS_CONST != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6297,7 +6294,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
|
|||
if (IS_CONST != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6594,7 +6591,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
|
|||
closure_is_static = Z_FUNC_P(zfunc)->common.fn_flags & ZEND_ACC_STATIC;
|
||||
closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->call->func->common.fn_flags & ZEND_ACC_STATIC;
|
||||
if (closure_is_static || closure_is_being_defined_inside_static_context) {
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(called_scope), NULL TSRMLS_CC);
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
|
||||
} else {
|
||||
zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EG(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC);
|
||||
}
|
||||
|
@ -7126,7 +7123,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
|
|||
if (IS_CONST != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8112,7 +8109,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
|
|||
}
|
||||
|
||||
EX(call) = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
|
@ -13370,7 +13367,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
|
|||
}
|
||||
|
||||
EX(call) = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
|
@ -15415,7 +15412,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
|
|||
if (IS_VAR != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17643,7 +17640,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
|
|||
if (IS_VAR != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19838,7 +19835,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
|
|||
if (IS_VAR != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21302,7 +21299,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
|
|||
if (IS_VAR != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23205,7 +23202,7 @@ static int ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
|
|||
if (IS_VAR != IS_CONST) {
|
||||
/* previous opcode is ZEND_FETCH_CLASS */
|
||||
if ((opline-1)->extended_value == ZEND_FETCH_CLASS_PARENT || (opline-1)->extended_value == ZEND_FETCH_CLASS_SELF) {
|
||||
ce = EG(called_scope);
|
||||
ce = EX(called_scope);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30500,7 +30497,7 @@ static int ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
|
|||
}
|
||||
|
||||
EX(call) = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EG(This)), EX(call) TSRMLS_CC);
|
||||
|
||||
if (!EG(active_symbol_table)) {
|
||||
zend_rebuild_symbol_table(TSRMLS_C);
|
||||
|
|
|
@ -39,7 +39,7 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value
|
|||
execute_data = EG(current_execute_data)->call;
|
||||
} else {
|
||||
execute_data = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), NULL TSRMLS_CC);
|
||||
(zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC);
|
||||
}
|
||||
EX(prev_execute_data) = EG(current_execute_data);
|
||||
i_init_execute_data(execute_data, op_array, return_value, EG(active_symbol_table) ? VM_FRAME_TOP_CODE : VM_FRAME_TOP_FUNCTION TSRMLS_CC);
|
||||
|
|
|
@ -287,7 +287,7 @@ static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char
|
|||
zend_try {
|
||||
if (EG(current_execute_data)) {
|
||||
EG(current_execute_data)->call = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EG(current_execute_data)->called_scope, Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
}
|
||||
zend_execute(new_op_array, &result TSRMLS_CC);
|
||||
if (PHAR_G(cwd)) {
|
||||
|
|
|
@ -293,7 +293,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
|
|||
ZVAL_UNDEF(&result);
|
||||
if (EG(current_execute_data)) {
|
||||
EG(current_execute_data)->call = zend_vm_stack_push_call_frame(
|
||||
(zend_function*)new_op_array, 0, 0, EG(called_scope), Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
(zend_function*)new_op_array, 0, 0, EG(current_execute_data)->called_scope, Z_OBJ(EG(This)), EG(current_execute_data)->call TSRMLS_CC);
|
||||
}
|
||||
zend_execute(new_op_array, &result TSRMLS_CC);
|
||||
|
||||
|
|
|
@ -4765,9 +4765,9 @@ PHP_FUNCTION(forward_static_call)
|
|||
|
||||
fci.retval = &retval;
|
||||
|
||||
if (EG(called_scope) &&
|
||||
instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
|
||||
fci_cache.called_scope = EG(called_scope);
|
||||
if (EG(current_execute_data)->called_scope &&
|
||||
instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) {
|
||||
fci_cache.called_scope = EG(current_execute_data)->called_scope;
|
||||
}
|
||||
|
||||
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
||||
|
@ -4791,9 +4791,9 @@ PHP_FUNCTION(forward_static_call_array)
|
|||
zend_fcall_info_args(&fci, params TSRMLS_CC);
|
||||
fci.retval = &retval;
|
||||
|
||||
if (EG(called_scope) &&
|
||||
instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
|
||||
fci_cache.called_scope = EG(called_scope);
|
||||
if (EG(current_execute_data)->called_scope &&
|
||||
instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) {
|
||||
fci_cache.called_scope = EG(current_execute_data)->called_scope;
|
||||
}
|
||||
|
||||
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue