From: Dmitry Stogov Date: Tue, 21 Apr 2015 20:26:34 +0000 (+0300) Subject: Fixed zend_string related inconsistencies X-Git-Tag: PRE_PHP7_NSAPI_REMOVAL~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0c07c90f248ffdf11ee8bdf9309107f5776bf54;p=php Fixed zend_string related inconsistencies --- diff --git a/Zend/zend_string.c b/Zend/zend_string.c index f20304570a..e8685a42b2 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -53,6 +53,7 @@ void zend_interned_strings_init(void) CG(interned_strings).nTableMask = -CG(interned_strings).nTableSize; HT_SET_DATA_ADDR(&CG(interned_strings), pemalloc(HT_SIZE(&CG(interned_strings)), 1)); HT_HASH_RESET(&CG(interned_strings)); + CG(interned_strings).u.flags |= HASH_FLAG_INITIALIZED; /* interned empty string */ str = zend_string_alloc(sizeof("")-1, 1); diff --git a/Zend/zend_string.h b/Zend/zend_string.h index 97528a71f3..0774646b2c 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -44,6 +44,7 @@ END_EXTERN_C() #define STR_ALLOCA_ALLOC(str, _len, use_heap) do { \ (str) = (zend_string *)do_alloca(ZEND_MM_ALIGNED_SIZE(_STR_HEADER_SIZE + (_len) + 1), (use_heap)); \ GC_REFCOUNT(str) = 1; \ + GC_TYPE_INFO(str) = IS_STRING; \ (str)->h = 0; \ (str)->len = (_len); \ } while (0) diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 8577ba3834..8259cfa9af 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -466,6 +466,7 @@ static void accel_use_shm_interned_strings(void) auto_global = (zend_auto_global*)Z_PTR(p->val);; + zend_string_addref(auto_global->name); auto_global->name = accel_new_interned_string(auto_global->name); if (p->key) { p->key = accel_new_interned_string(p->key);