mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
GC fix
This commit is contained in:
parent
ec4c40aa00
commit
833e01343d
@ -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 {
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user