Skip to content

Commit 564d7ba

Browse files
committed
Cleanup
1 parent b30d089 commit 564d7ba

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

Zend/zend_execute.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ ZEND_API ZEND_COLD void zend_verify_arg_error(
712712

713713
zend_string_release(need_msg);
714714
} else {
715-
zend_missing_arg_error(ptr, arg_num);
715+
zend_missing_arg_error(ptr);
716716
}
717717
}
718718

@@ -1130,15 +1130,10 @@ static ZEND_COLD void zend_internal_call_arginfo_violation(zend_function *fbc)
11301130
}
11311131
#endif
11321132

1133-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data, uint32_t arg_num)
1133+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data)
11341134
{
11351135
zend_execute_data *ptr = EX(prev_execute_data);
11361136

1137-
if (arg_num < EX_NUM_ARGS()) {
1138-
zend_argument_error(zend_ce_argument_count_error, arg_num, "not passed");
1139-
return;
1140-
}
1141-
11421137
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
11431138
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
11441139
EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
@@ -4505,7 +4500,7 @@ ZEND_API int ZEND_FASTCALL zend_handle_undef_args(zend_execute_data *call) {
45054500
} else {
45064501
ZEND_ASSERT(opline->opcode == ZEND_RECV);
45074502
start_fake_frame(call, opline);
4508-
zend_missing_arg_error(call, i + 1);
4503+
zend_argument_error(zend_ce_argument_count_error, i + 1, "not passed");
45094504
end_fake_frame(call);
45104505
}
45114506
}

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ ZEND_API int zend_eval_stringl_ex(const char *str, size_t str_len, zval *retval_
5555
/* export zend_pass_function to allow comparisons against it */
5656
extern ZEND_API const zend_internal_function zend_pass_function;
5757

58-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data, uint32_t arg_num);
58+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *execute_data);
5959
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc);
6060
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
6161

Zend/zend_vm_def.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5286,14 +5286,14 @@ ZEND_VM_HOT_HANDLER(199, ZEND_CHECK_NAMED, UNUSED, UNUSED)
52865286
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
52875287
}
52885288

5289-
ZEND_VM_COLD_HELPER(zend_missing_arg_helper, ANY, ANY, uint32_t arg_num)
5289+
ZEND_VM_COLD_HELPER(zend_missing_arg_helper, ANY, ANY)
52905290
{
52915291
#ifdef ZEND_VM_IP_GLOBAL_REG
52925292
USE_OPLINE
52935293

52945294
SAVE_OPLINE();
52955295
#endif
5296-
zend_missing_arg_error(execute_data, arg_num);
5296+
zend_missing_arg_error(execute_data);
52975297
HANDLE_EXCEPTION();
52985298
}
52995299

@@ -5312,12 +5312,15 @@ ZEND_VM_COLD_HELPER(zend_verify_recv_arg_type_helper, ANY, ANY, zval *op_1)
53125312
ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED, CACHE_SLOT)
53135313
{
53145314
USE_OPLINE
5315-
zval *param = EX_VAR(opline->result.var);
5316-
if (UNEXPECTED(Z_ISUNDEF_P(param))) {
5317-
uint32_t arg_num = opline->op1.num;
5318-
ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper, arg_num, arg_num);
5315+
uint32_t arg_num = opline->op1.num;
5316+
zval *param;
5317+
5318+
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
5319+
ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper);
53195320
}
53205321

5322+
param = EX_VAR(opline->result.var);
5323+
53215324
if (UNEXPECTED(!(opline->op2.num & (1u << Z_TYPE_P(param))))) {
53225325
ZEND_VM_DISPATCH_TO_HELPER(zend_verify_recv_arg_type_helper, op_1, param);
53235326
}
@@ -5328,10 +5331,10 @@ ZEND_VM_HOT_HANDLER(63, ZEND_RECV, NUM, UNUSED, CACHE_SLOT)
53285331
ZEND_VM_HOT_TYPE_SPEC_HANDLER(ZEND_RECV, op->op2.num == MAY_BE_ANY, ZEND_RECV_NOTYPE, NUM, NUM, CACHE_SLOT)
53295332
{
53305333
USE_OPLINE
5334+
uint32_t arg_num = opline->op1.num;
53315335

5332-
if (UNEXPECTED(Z_ISUNDEF_P(EX_VAR(opline->result.var)))) {
5333-
uint32_t arg_num = opline->op1.num;
5334-
ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper, arg_num, arg_num);
5336+
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
5337+
ZEND_VM_DISPATCH_TO_HELPER(zend_missing_arg_helper);
53355338
}
53365339

53375340
ZEND_VM_NEXT_OPCODE();
@@ -5347,7 +5350,7 @@ ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST, CACHE_SLOT)
53475350

53485351
arg_num = opline->op1.num;
53495352
param = EX_VAR(opline->result.var);
5350-
if (arg_num > EX_NUM_ARGS() || Z_ISUNDEF_P(param)) {
5353+
if (arg_num > EX_NUM_ARGS()) {
53515354
zval *default_value = RT_CONSTANT(opline, opline->op2);
53525355

53535356
if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) {

Zend/zend_vm_execute.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,14 +2151,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
21512151
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
21522152
}
21532153

2154-
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_missing_arg_helper_SPEC(uint32_t arg_num ZEND_OPCODE_HANDLER_ARGS_DC)
2154+
static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
21552155
{
21562156
#ifdef ZEND_VM_IP_GLOBAL_REG
21572157
USE_OPLINE
21582158

21592159
SAVE_OPLINE();
21602160
#endif
2161-
zend_missing_arg_error(execute_data, arg_num);
2161+
zend_missing_arg_error(execute_data);
21622162
HANDLE_EXCEPTION();
21632163
}
21642164

@@ -2177,10 +2177,10 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_ve
21772177
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_NOTYPE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
21782178
{
21792179
USE_OPLINE
2180+
uint32_t arg_num = opline->op1.num;
21802181

2181-
if (UNEXPECTED(Z_ISUNDEF_P(EX_VAR(opline->result.var)))) {
2182-
uint32_t arg_num = opline->op1.num;
2183-
ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(arg_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
2182+
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
2183+
ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
21842184
}
21852185

21862186
ZEND_VM_NEXT_OPCODE();
@@ -3096,7 +3096,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CON
30963096

30973097
arg_num = opline->op1.num;
30983098
param = EX_VAR(opline->result.var);
3099-
if (arg_num > EX_NUM_ARGS() || Z_ISUNDEF_P(param)) {
3099+
if (arg_num > EX_NUM_ARGS()) {
31003100
zval *default_value = RT_CONSTANT(opline, opline->op2);
31013101

31023102
if (Z_OPT_TYPE_P(default_value) == IS_CONSTANT_AST) {
@@ -3193,12 +3193,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_
31933193
static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
31943194
{
31953195
USE_OPLINE
3196-
zval *param = EX_VAR(opline->result.var);
3197-
if (UNEXPECTED(Z_ISUNDEF_P(param))) {
3198-
uint32_t arg_num = opline->op1.num;
3199-
ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(arg_num ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
3196+
uint32_t arg_num = opline->op1.num;
3197+
zval *param;
3198+
3199+
if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
3200+
ZEND_VM_TAIL_CALL(zend_missing_arg_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
32003201
}
32013202

3203+
param = EX_VAR(opline->result.var);
3204+
32023205
if (UNEXPECTED(!(opline->op2.num & (1u << Z_TYPE_P(param))))) {
32033206
ZEND_VM_TAIL_CALL(zend_verify_recv_arg_type_helper_SPEC(param ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
32043207
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11040,7 +11040,6 @@ static int zend_jit_recv(dasm_State **Dst, const zend_op *opline, const zend_op_
1104011040
| ADDR_OP2_2 mov, aword EX->opline, opline, r0
1104111041
}
1104211042
| mov FCARG1a, FP
11043-
| mov FCARG2d, arg_num
1104411043
| EXT_CALL zend_missing_arg_error, r0
1104511044
| jmp ->exception_handler
1104611045
|.code

0 commit comments

Comments
 (0)