]> granicus.if.org Git - php/commitdiff
- Allow is_ref to become 0 in case the refcount is back to 1.
authorAndi Gutmans <andi@php.net>
Wed, 26 Jan 2000 05:03:22 +0000 (05:03 +0000)
committerAndi Gutmans <andi@php.net>
Wed, 26 Jan 2000 05:03:22 +0000 (05:03 +0000)
Zend/zend_execute_API.c
Zend/zend_opcode.c

index 912310a5552103b6a5ebb634469f69134edeacd8..11a24eec01a2cdacebc8fcb487120dc65962618e 100644 (file)
@@ -217,9 +217,11 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
        if ((*zval_ptr)->refcount==0) {
                zval_dtor(*zval_ptr);
                safe_free_zval_ptr(*zval_ptr);
+       } else if ((*zval_ptr)->refcount == 1) {
+               (*zval_ptr)->is_ref = 0;
        }
 }
-
+       
 
 ZEND_API inline int i_zend_is_true(zval *op)
 {
index 4ca0b43eed1e5f74a36d16920d93ea8ae1775730..a80aa26bc700aceac771f4aeed9bb57c412ff014 100644 (file)
@@ -313,9 +313,11 @@ void pass_include_eval(zend_op_array *op_array)
        while (opline<end) {
                if (opline->op1.op_type==IS_CONST) {
                        opline->op1.u.constant.is_ref = 1;
+                       opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
                }
                if (opline->op2.op_type==IS_CONST) {
                        opline->op2.u.constant.is_ref = 1;
+                       opline->op2.u.constant.refcount = 2;
                }
                opline++;
        }