Skip to content

Commit 788e916

Browse files
committed
Cleanup
1 parent 66c3cfd commit 788e916

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Zend/tests/partial_application/errors_005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ try {
1212

1313
?>
1414
--EXPECT--
15-
ArgumentCountError: __invoke(): Argument #3 ($c) must be passed explicitly, because the default value is not known
15+
ArgumentCountError: Closure::__invoke(): Argument #3 ($c) must be passed explicitly, because the default value is not known

Zend/zend_partial.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define IS_STATIC_CLOSURE(function) \
3737
(((function)->common.fn_flags & (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE)) == (ZEND_ACC_STATIC|ZEND_ACC_CLOSURE))
3838

39-
ZEND_COLD static zend_never_inline void zend_partial_args_underflow(
39+
static zend_never_inline ZEND_COLD void zend_partial_args_underflow(
4040
const zend_function *function, uint32_t args, uint32_t expected)
4141
{
4242
zend_string *symbol = get_function_or_method_name(function);
@@ -50,7 +50,7 @@ ZEND_COLD static zend_never_inline void zend_partial_args_underflow(
5050
zend_string_release(symbol);
5151
}
5252

53-
ZEND_COLD static zend_never_inline void zend_partial_args_overflow(
53+
static zend_never_inline ZEND_COLD void zend_partial_args_overflow(
5454
const zend_function *function, uint32_t args, uint32_t expected)
5555
{
5656
zend_string *symbol = get_function_or_method_name(function);
@@ -338,10 +338,10 @@ static zend_ast *zp_type_to_ast(const zend_type type)
338338
}
339339

340340
/* Can not use zend_argument_error() as the function is not on the stack */
341-
ZEND_COLD static void zp_argument_error(zend_class_entry *error_ce,
341+
static zend_never_inline ZEND_COLD void zp_argument_error(zend_class_entry *error_ce,
342342
zend_function *function, uint32_t arg_num, const char *format, ...)
343343
{
344-
zend_string *func_name = function->common.function_name;
344+
zend_string *func_name = get_function_or_method_name(function);
345345
const char *arg_name = get_function_arg_name(function, arg_num);
346346

347347
char *message = NULL;
@@ -488,7 +488,7 @@ static zend_string *zp_pfa_name(const zend_op_array *declaring_op_array,
488488
return name;
489489
}
490490

491-
zend_ast *zp_compile_forwarding_call(
491+
static zend_ast *zp_compile_forwarding_call(
492492
zval *this_ptr, zend_function *function,
493493
uint32_t argc, zval *argv, zend_array *extra_named_params,
494494
zend_string **param_names, bool variadic_partial, uint32_t num_args,
@@ -617,7 +617,7 @@ zend_ast *zp_compile_forwarding_call(
617617
return NULL;
618618
}
619619

620-
uint32_t zp_compute_num_required(zend_function *function,
620+
static uint32_t zp_compute_num_required(zend_function *function,
621621
uint32_t orig_offset, uint32_t new_offset,
622622
uint32_t num_required) {
623623
if (orig_offset < function->common.num_args) {
@@ -653,7 +653,7 @@ static bool zp_is_non_dynamic_call_func(zend_function *function)
653653
return false;
654654
}
655655

656-
zend_op_array *zp_compile(zval *this_ptr, zend_function *function,
656+
static zend_op_array *zp_compile(zval *this_ptr, zend_function *function,
657657
uint32_t argc, zval *argv, zend_array *extra_named_params,
658658
const zend_array *named_positions,
659659
const zend_op_array *declaring_op_array,
@@ -662,7 +662,7 @@ zend_op_array *zp_compile(zval *this_ptr, zend_function *function,
662662

663663
zend_op_array *op_array = NULL;
664664

665-
if (zp_is_non_dynamic_call_func(function)) {
665+
if (UNEXPECTED(zp_is_non_dynamic_call_func(function))) {
666666
zend_throw_error(NULL, "Cannot call %.*s() dynamically",
667667
(int) ZSTR_LEN(function->common.function_name), ZSTR_VAL(function->common.function_name));
668668
return NULL;
@@ -1001,7 +1001,7 @@ zend_op_array *zp_compile(zval *this_ptr, zend_function *function,
10011001
goto clean;
10021002
}
10031003

1004-
zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function,
1004+
static zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function,
10051005
uint32_t argc, zval *argv, zend_array *extra_named_params,
10061006
const zend_array *named_positions,
10071007
const zend_op_array *declaring_op_array,
@@ -1034,7 +1034,7 @@ zend_op_array *zp_get_op_array(zval *this_ptr, zend_function *function,
10341034
}
10351035

10361036
/* Bind pre-bound arguments as lexical vars */
1037-
void zp_bind(zval *result, zend_function *function, uint32_t argc, zval *argv,
1037+
static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval *argv,
10381038
zend_array *extra_named_params) {
10391039

10401040
zend_arg_info *arg_infos = function->common.arg_info;

0 commit comments

Comments
 (0)