Skip to content

Commit ac2c16e

Browse files
committed
Copy the original arg_info in zend_closure_from_frame
1 parent 8d8ec74 commit ac2c16e

File tree

4 files changed

+2
-15
lines changed

4 files changed

+2
-15
lines changed

Zend/zend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,6 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
10821082
#endif
10831083

10841084
zend_enum_startup();
1085-
zend_closure_startup();
10861085
}
10871086
/* }}} */
10881087

Zend/zend_closures.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,6 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *func, zend_clas
878878
}
879879
/* }}} */
880880

881-
static zend_arg_info trampoline_arg_info[1];
882-
883881
void zend_closure_from_frame(zval *return_value, const zend_execute_data *call) { /* {{{ */
884882
zval instance;
885883
zend_internal_function trampoline;
@@ -904,9 +902,7 @@ void zend_closure_from_frame(zval *return_value, const zend_execute_data *call)
904902
trampoline.function_name = mptr->common.function_name;
905903
trampoline.scope = mptr->common.scope;
906904
trampoline.doc_comment = NULL;
907-
if (trampoline.fn_flags & ZEND_ACC_VARIADIC) {
908-
trampoline.arg_info = trampoline_arg_info;
909-
}
905+
trampoline.arg_info = mptr->common.arg_info;
910906
trampoline.attributes = mptr->common.attributes;
911907

912908
zend_free_trampoline(mptr);
@@ -943,11 +939,3 @@ void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val) /* {
943939
ZVAL_COPY_VALUE(var, val);
944940
}
945941
/* }}} */
946-
947-
void zend_closure_startup(void)
948-
{
949-
/* __call and __callStatic name the arguments "$arguments" in the docs. */
950-
trampoline_arg_info[0].name = zend_string_init_interned("arguments", strlen("arguments"), true);
951-
trampoline_arg_info[0].type = (zend_type)ZEND_TYPE_INIT_CODE(IS_MIXED, false, _ZEND_ARG_INFO_FLAGS(false, 1, 0));
952-
trampoline_arg_info[0].default_value = NULL;
953-
}

Zend/zend_closures.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ BEGIN_EXTERN_C()
2828
#define ZEND_CLOSURE_OBJECT(op_array) \
2929
((zend_object*)((char*)(op_array) - sizeof(zend_object)))
3030

31-
void zend_closure_startup(void);
3231
void zend_register_closure_ce(void);
3332
void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var);
3433
void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val);

Zend/zend_object_handlers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,5 +2576,6 @@ ZEND_API const zend_object_handlers std_object_handlers = {
25762576

25772577
void zend_object_handlers_startup(void) {
25782578
zend_call_trampoline_arginfo[0].name = ZSTR_KNOWN(ZEND_STR_ARGUMENTS);
2579+
zend_call_trampoline_arginfo[0].type = (zend_type)ZEND_TYPE_INIT_CODE(IS_MIXED, false, _ZEND_ARG_INFO_FLAGS(false, 1, 0));
25792580
zend_property_hook_arginfo[0].name = ZSTR_KNOWN(ZEND_STR_VALUE);
25802581
}

0 commit comments

Comments
 (0)