From: Zeev Suraski Date: Sat, 29 May 1999 12:00:32 +0000 (+0000) Subject: Correct fix X-Git-Tag: BEFORE_REMOVING_GC_STEP1~247 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7ee45e13cdb263cd3ff10099efd5ade9efe90e1;p=php Correct fix --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 2eb15542bd..f678d72d4b 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -272,10 +272,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, zval *valu } } } else { - if (--variable_ptr->refcount==0) { - zval_dtor(variable_ptr); - } - variable_ptr = *variable_ptr_ptr; + variable_ptr->refcount--; if (variable_ptr->refcount==0) { switch (type) { case IS_VAR: @@ -283,6 +280,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, zval *valu if (variable_ptr==value) { variable_ptr->refcount++; } else if (value->is_ref) { + zendi_zval_dtor(*variable_ptr); *variable_ptr = *value; zval_copy_ctor(variable_ptr); variable_ptr->refcount=1;