]> granicus.if.org Git - php/commitdiff
- Baby patch towards making the damn pass-by-ref work.
authorAndi Gutmans <andi@php.net>
Mon, 20 Nov 2000 20:49:42 +0000 (20:49 +0000)
committerAndi Gutmans <andi@php.net>
Mon, 20 Nov 2000 20:49:42 +0000 (20:49 +0000)
Zend/zend_compile.c
Zend/zend_execute.c

index cf1b4956b944003bdf5de270112fc88f082e03c6..f8c1a722d4ebcaad73650ee3226f1b9e1a0f8b56 100644 (file)
@@ -945,6 +945,7 @@ void zend_do_pass_param(znode *param, int op, int offset CLS_DC)
                                                         * as far as reference counting is concerned.  Treat them
                                                         * as if they were variables here.
                                                         */
+                               break;
                        case IS_VAR:
                                op = ZEND_SEND_VAR_NO_REF;
                                break;
index 6035be3d0cf4d9397061300d3e70e330b73b17b5..7308c21828cd97b6914ec924339007f833f3efb1 100644 (file)
@@ -1643,11 +1643,18 @@ do_fcall_common:
                                }
                                {
                                        zval *valptr;
+                                       zval *value;
+
+                                       value = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
 
                                        ALLOC_ZVAL(valptr);
-                                       *valptr = Ts[opline->op1.u.var].tmp_var;
+                                       *valptr = *value;
+                                       if (!EG(free_op1)) {
+                                               zval_copy_ctor(valptr);
+                                       }
                                        INIT_PZVAL(valptr);
                                        zend_ptr_stack_push(&EG(argument_stack), valptr);
+                                       FREE_OP(&opline->op1, EG(free_op1));  /* for string offsets */
                                }
                                NEXT_OPCODE();
                        case ZEND_SEND_VAR: