Fixed bug #52939 (zend_call_function does not respect ZEND_SEND_PREFER_REF)

This commit is contained in:
Dmitry Stogov 2010-10-13 08:51:39 +00:00
parent a1888f585c
commit f4173a8ece
2 changed files with 14 additions and 1 deletions

View file

@ -10,6 +10,11 @@ $ar1 = array("row1" => 2, "row2" => 1);
$args = array(&$ar1);
var_dump(call_user_func_array("array_multisort", $args));
var_dump($ar1);
$ar1 = array("row1" => 2, "row2" => 1);
$args = array($ar1);
var_dump(call_user_func_array("array_multisort", $args));
var_dump($ar1);
?>
--EXPECT--
bool(true)
@ -26,3 +31,10 @@ array(2) {
["row1"]=>
int(2)
}
bool(true)
array(2) {
["row1"]=>
int(2)
["row2"]=>
int(1)
}

View file

@ -854,7 +854,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (!PZVAL_IS_REF(*fci->params[i]) && Z_REFCOUNT_PP(fci->params[i]) > 1) {
zval *new_zval;
if (fci->no_separation) {
if (fci->no_separation &&
!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
if(i) {
/* hack to clean up the stack */
zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);