diff options
| author | Zeev Suraski <zeev@php.net> | 2000-01-24 17:29:15 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2000-01-24 17:29:15 +0000 |
| commit | adec56938e407fd2b3f380c4ccd4fa89d0ea564b (patch) | |
| tree | 0d1189902c82a14fab0c17d427cb47d6dc2a2d24 /Zend | |
| parent | e6ba28b680dc3e8d118e7a350e27fc26b11e4e50 (diff) | |
| download | php-git-adec56938e407fd2b3f380c4ccd4fa89d0ea564b.tar.gz | |
Fixes
Diffstat (limited to 'Zend')
| -rw-r--r-- | Zend/zend_execute.c | 2 | ||||
| -rw-r--r-- | Zend/zend_execute_API.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 2e30fc170b..1bac5e2f96 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -346,7 +346,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2 variable_ptr->is_ref = 1; if (type!=IS_TMP_VAR) { zendi_zval_copy_ctor(*variable_ptr); - + value->refcount--; } } } else { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index c56a876f16..8c610ef301 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -487,7 +487,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) { variable_ptr_ptr = &EG(uninitialized_zval_ptr); /* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ - } else if (*variable_ptr_ptr != *value_ptr_ptr) { + } else if (variable_ptr_ptr != value_ptr_ptr) { variable_ptr->refcount--; if (variable_ptr->refcount==0) { zendi_zval_dtor(*variable_ptr); @@ -510,7 +510,10 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var *variable_ptr_ptr = value_ptr; value_ptr->refcount++; } else { - /* nothing to do */ + if (variable_ptr->refcount>1) { /* we need to break away */ + SEPARATE_ZVAL(variable_ptr_ptr); + } + (*variable_ptr_ptr)->is_ref = 1; } if (result && (result->op_type != IS_UNUSED)) { |
