Skip to content

Commit 795d2cb

Browse files
committed
Reuse warning function
1 parent 58f51f8 commit 795d2cb

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_non_static_method_cal
19311931
ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name));
19321932
}
19331933

1934-
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num)
1934+
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num)
19351935
{
19361936
const char *arg_name = get_function_arg_name(func, arg_num);
19371937

Zend/zend_execute.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ extern ZEND_API const zend_internal_function zend_pass_function;
5757

5858
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);
60+
ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num);
6061

6162
ZEND_API zend_bool ZEND_FASTCALL zend_verify_ref_assignable_zval(zend_reference *ref, zval *zv, zend_bool strict);
6263
ZEND_API zend_bool ZEND_FASTCALL zend_verify_prop_assignable_by_ref(zend_property_info *prop_info, zval *orig_val, zend_bool strict);

Zend/zend_execute_API.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -746,18 +746,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
746746
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
747747
/* By-value send is not allowed -- emit a warning,
748748
* but still perform the call with a by-value send. */
749-
const char *arg_name = get_function_arg_name(func, i + 1);
750-
751-
zend_error(E_WARNING,
752-
"%s%s%s(): Argument #%d%s%s%s must be passed by reference, value given",
753-
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
754-
func->common.scope ? "::" : "",
755-
ZSTR_VAL(func->common.function_name),
756-
i+1,
757-
arg_name ? " ($" : "",
758-
arg_name ? arg_name : "",
759-
arg_name ? ")" : ""
760-
);
749+
zend_param_must_be_ref(func, i + 1);
761750
if (UNEXPECTED(EG(exception))) {
762751
ZEND_CALL_NUM_ARGS(call) = i;
763752
zend_vm_stack_free_args(call);

0 commit comments

Comments
 (0)