diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-05-06 16:03:16 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-05-06 16:03:16 +0000 |
commit | 833e01343de06574271db9b0f3e2a3a5d61a89f1 (patch) | |
tree | 96a1fbee2c1f25124ab5d21b38a7a012ef49f9c0 /Zend/zend_execute.c | |
parent | ec4c40aa00b478ced8c344907a7578eb454f83a2 (diff) | |
download | php-git-833e01343de06574271db9b0f3e2a3a5d61a89f1.tar.gz |
GC fix
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index bf8884907c..4f7efea1c9 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -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 { |