summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2004-06-02 12:48:19 +0000
committerStanislav Malyshev <stas@php.net>2004-06-02 12:48:19 +0000
commit176f6d8e6e37880dd1f2e389364446087f56813c (patch)
tree1c498d92518291db6fa6fa9902dd943a683a4d70
parentc59be44de1cae08100e8ad181596d2bad2705f62 (diff)
downloadphp-git-176f6d8e6e37880dd1f2e389364446087f56813c.tar.gz
fix incdec - make value's refcount non-zero when passing to
write_property - otherwise __set caller cleanup could kill it.
-rw-r--r--Zend/zend_execute.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index fc77357f6b..195131ceda 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1275,11 +1275,9 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
*retval = *z;
zendi_zval_copy_ctor(*retval);
incdec_op(z);
+ z->refcount++;
Z_OBJ_HT_P(object)->write_property(object, property, z TSRMLS_CC);
- if (z->refcount == 0) {
- zval_dtor(z);
- FREE_ZVAL(z);
- }
+ zval_ptr_dtor(&z);
}
FREE_OP(Ts, op2, EG(free_op2));