From: Andi Gutmans Date: Wed, 26 Jan 2000 05:03:22 +0000 (+0000) Subject: - Allow is_ref to become 0 in case the refcount is back to 1. X-Git-Tag: BEFORE_SAPIFICATION_FEB_10_2000~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4585f7bf1f8e5fb52aebd0990d67fa017ea8a918;p=php - Allow is_ref to become 0 in case the refcount is back to 1. --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 912310a555..11a24eec01 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -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) { diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 4ca0b43eed..a80aa26bc7 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -313,9 +313,11 @@ void pass_include_eval(zend_op_array *op_array) while (oplineop1.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++; }