From: Stanislav Malyshev Date: Fri, 18 Dec 2009 19:12:11 +0000 (+0000) Subject: fix regression bug #50394: Reference argument converted to value in __call X-Git-Tag: php-5.2.13RC1~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08f4721e73d3b900ccff494bda62304b9ad3f344;p=php fix regression bug #50394: Reference argument converted to value in __call --- diff --git a/Zend/tests/bug50394.phpt b/Zend/tests/bug50394.phpt new file mode 100644 index 0000000000..e6069d3666 --- /dev/null +++ b/Zend/tests/bug50394.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #50394: Reference argument converted to value in __call +--FILE-- +type == ZEND_INTERNAL_FUNCTION + && (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0 && !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1) && PZVAL_IS_REF(*fci->params[i])) { SEPARATE_ZVAL(fci->params[i]); diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index d56c263d5a..41c2e08e87 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -771,7 +771,7 @@ static inline union _zend_function *zend_get_user_call_function(zend_class_entry call_user_call->arg_info = NULL; call_user_call->num_args = 0; call_user_call->scope = ce; - call_user_call->fn_flags = 0; + call_user_call->fn_flags = ZEND_ACC_CALL_VIA_HANDLER; call_user_call->function_name = estrndup(method_name, method_len); call_user_call->pass_rest_by_reference = 0; call_user_call->return_reference = ZEND_RETURN_VALUE;