This commit is contained in:
Dmitry Stogov 2008-05-06 16:03:16 +00:00
parent ec4c40aa00
commit 833e01343d
2 changed files with 19 additions and 9 deletions

View File

@ -83,9 +83,13 @@ static inline void zend_pzval_unlock_func(zval *z, zend_free_op *should_free, in
static inline void zend_pzval_unlock_free_func(zval *z)
{
if (!Z_DELREF_P(z)) {
GC_REMOVE_ZVAL_FROM_BUFFER(z);
zval_dtor(z);
safe_free_zval_ptr(z);
TSRMLS_FETCH();
if (z != &EG(uninitialized_zval)) {
GC_REMOVE_ZVAL_FROM_BUFFER(z);
zval_dtor(z);
efree(z);
}
}
}
@ -699,9 +703,11 @@ static inline zval* zend_assign_to_variable(zval **variable_ptr_ptr, zval *value
} else {
Z_ADDREF_P(value);
*variable_ptr_ptr = value;
GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
zendi_zval_dtor(*variable_ptr);
safe_free_zval_ptr(variable_ptr);
if (variable_ptr != &EG(uninitialized_zval)) {
GC_REMOVE_ZVAL_FROM_BUFFER(variable_ptr);
zval_dtor(variable_ptr);
efree(variable_ptr);
}
return value;
}
} else {

View File

@ -418,9 +418,13 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{ */
#endif
Z_DELREF_PP(zval_ptr);
if (Z_REFCOUNT_PP(zval_ptr) == 0) {
GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
zval_dtor(*zval_ptr);
safe_free_zval_ptr_rel(*zval_ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
TSRMLS_FETCH();
if (*zval_ptr != &EG(uninitialized_zval)) {
GC_REMOVE_ZVAL_FROM_BUFFER(*zval_ptr);
zval_dtor(*zval_ptr);
efree_rel(*zval_ptr);
}
} else {
TSRMLS_FETCH();