summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-02-08 20:10:47 +0000
committerZeev Suraski <zeev@php.net>2000-02-08 20:10:47 +0000
commitca5622c71179156d27442fd760b8164261bba6c2 (patch)
tree290100241651667f4da9dc3eea3d305c8fd8dcf2 /Zend/zend_execute.c
parenta7063b1aee0d8a439f0db1bf68fb56f052efd810 (diff)
downloadphp-git-ca5622c71179156d27442fd760b8164261bba6c2.tar.gz
Fix an elusive bug
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index d798e5f59d..53514d1c3b 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -332,11 +332,12 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (PZVAL_IS_REF(variable_ptr)) {
if (variable_ptr!=value) {
short refcount=variable_ptr->refcount;
+ zval garbage;
if (type!=IS_TMP_VAR) {
value->refcount++;
}
- zendi_zval_dtor(*variable_ptr);
+ garbage = *variable_ptr;
*variable_ptr = *value;
variable_ptr->refcount = refcount;
variable_ptr->is_ref = 1;
@@ -344,6 +345,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zendi_zval_copy_ctor(*variable_ptr);
value->refcount--;
}
+ zendi_zval_dtor(garbage);
}
} else {
variable_ptr->refcount--;