summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-06-09 21:39:12 +0000
committerZeev Suraski <zeev@php.net>1999-06-09 21:39:12 +0000
commit95c9e3014ae7472f9c31ed7e02704ec5340ccb41 (patch)
treedceb893e8ee7313fa93ba92af20449d3f7418f10 /Zend/zend_execute.c
parentb331ead5bf2b46c8b0511ccf88dcea57f6f45680 (diff)
downloadphp-git-95c9e3014ae7472f9c31ed7e02704ec5340ccb41.tar.gz
* Fix cases where you assign an array element to the parent array (the array was
being erased before the assignment, so the element was being smashed).
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 8557c7141f..b18a8ef27d 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -285,15 +285,18 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr==value) {
variable_ptr->refcount++;
} else if (value->is_ref) {
+ zval tmp = *value;
+
+ tmp = *value;
+ zval_copy_ctor(&tmp);
+ tmp.refcount=1;
zendi_zval_dtor(*variable_ptr);
- *variable_ptr = *value;
- zval_copy_ctor(variable_ptr);
- variable_ptr->refcount=1;
+ *variable_ptr = tmp;
} else {
+ value->refcount++;
zendi_zval_dtor(*variable_ptr);
safe_free_zval_ptr(variable_ptr);
*variable_ptr_ptr = value;
- value->refcount++;
}
break;
case IS_TMP_VAR: