From 1ee94f56c45c90a225900ccb99ff70080c583d5a Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 18 Jan 2018 12:41:27 +0300 Subject: [PATCH] Removed IS_TYPE_COPYABLE flag from IS_STRING zvals. --- UPGRADING.INTERNALS | 6 ++++++ Zend/zend_types.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 45143ead7c..19eeacc57e 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -14,6 +14,7 @@ PHP 7.3 INTERNALS UPGRADE NOTES k. zend_fcall_info_cache.initialized l. php_hrtime_current() m. zend_cpu_supports() + n. IS_TYPE_COPYABLE 2. Build system changes a. Unix build system changes @@ -102,6 +103,11 @@ PHP 7.3 INTERNALS UPGRADE NOTES m. zend_cpu_supports() determines if a feature is supported by current cpu. + n. IS_STRING zvals don't set IS_TYPE_COPYALE anymore. This prevents string + duplication by zval_copy_ctor(), ZVAL_DUP() and SEPARATE_ZVAL*() macros. + Interned strings didn't set IS_TYPE_COPYALE, so they aren't affected at + all. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 94650c59e2..24f20913c2 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -476,7 +476,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) { /* extended types */ #define IS_INTERNED_STRING_EX IS_STRING -#define IS_STRING_EX (IS_STRING | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT)) +#define IS_STRING_EX (IS_STRING | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT)) #define IS_ARRAY_EX (IS_ARRAY | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT)) #define IS_OBJECT_EX (IS_OBJECT | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT)) #define IS_RESOURCE_EX (IS_RESOURCE | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT)) -- 2.50.1