summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-11-19 19:49:58 +0000
committerAndi Gutmans <andi@php.net>2000-11-19 19:49:58 +0000
commitce87ae4159417fcd65033229ee82212e87b31cf2 (patch)
tree6cb640d88db6d248f5299dda56f3142e50ed76b0 /Zend/zend_execute.c
parentc8a56ea11d0cfdd6338185428ffb411fbf63194c (diff)
downloadphp-git-ce87ae4159417fcd65033229ee82212e87b31cf2.tar.gz
- Try and fix the problem when sending references returned from a function by reference.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 6035be3d0c..74e1aae141 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1655,6 +1655,14 @@ do_fcall_common:
if (opline->extended_value==ZEND_DO_FCALL_BY_NAME
&& ARG_SHOULD_BE_SENT_BY_REF(opline->op2.u.opline_num, fbc, fbc->common.arg_types)) {
if (opline->opcode==ZEND_SEND_VAR_NO_REF) {
+ zval *varptr;
+
+ varptr = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
+ if (varptr != &EG(uninitialized_zval) && PZVAL_IS_REF(varptr)) {
+ varptr->refcount++;
+ zend_ptr_stack_push(&EG(argument_stack), varptr);
+ NEXT_OPCODE();
+ }
zend_error(E_ERROR, "Only variables can be passed by reference");
}
goto send_by_ref;