diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-03-05 13:55:56 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-03-05 13:55:56 +0400 |
| commit | 37337373287544f39d696c2fb357a56e99e6cecc (patch) | |
| tree | de36b9e92ed66ada6c24179a3bd68695f603f00f /Zend/zend_execute.h | |
| parent | dc889b69ef8947a87a93a59a24013d972b313158 (diff) | |
| download | php-git-37337373287544f39d696c2fb357a56e99e6cecc.tar.gz | |
Handle interned strings as non-refcounted scalars
Diffstat (limited to 'Zend/zend_execute.h')
| -rw-r--r-- | Zend/zend_execute.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 68792811c7..7a8755469a 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -73,7 +73,10 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC) { //??? IS_CONSTANT_TYPE_MASK used only for some rare cases - if (IS_REFCOUNTED(Z_TYPE_P(zval_ptr) & IS_CONSTANT_TYPE_MASK)) { + zend_uchar type = Z_TYPE_P(zval_ptr) & IS_CONSTANT_TYPE_MASK; + + if (IS_REFCOUNTED(type) && + (type != IS_STRING || !IS_INTERNED(Z_STR_P(zval_ptr)))) { if (!Z_DELREF_P(zval_ptr)) { ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); @@ -92,7 +95,7 @@ static zend_always_inline void i_zval_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LINE_DC TSRMLS_DC) { - if (IS_REFCOUNTED(Z_TYPE_P(zval_ptr))) { + if (Z_REFCOUNTED_P(zval_ptr)) { if (!Z_DELREF_P(zval_ptr)) { ZEND_ASSERT(zval_ptr != &EG(uninitialized_zval)); GC_REMOVE_ZVAL_FROM_BUFFER(zval_ptr); |
