summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.h
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_execute.h')
-rw-r--r--Zend/zend_execute.h7
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);