From: Xinchen Hui Date: Thu, 3 May 2012 14:39:53 +0000 (+0800) Subject: Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config) X-Git-Tag: php-5.4.4RC1~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72f19e9a8bcf5712b24fa333a26616eff19ac1ce;p=php Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config) --- diff --git a/NEWS b/NEWS index 8796cf4a19..9ef6abf66f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ PHP NEWS (Laruence) - Core: + . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config). + (Laruence) . Fixed missing bound check in iptcparse(). (chris at chiappa.net) . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy) . Fixed bug #61761 ('Overriding' a private static method with a different diff --git a/Zend/zend.c b/Zend/zend.c index dd299f1d87..37a1a27c7d 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */ void zend_post_startup(TSRMLS_D) /* {{{ */ { #ifdef ZTS + zend_encoding **script_encoding_list; + zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id); zend_executor_globals *executor_globals = ts_resource(executor_globals_id); @@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */ zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); free(compiler_globals->function_table); free(compiler_globals->class_table); - compiler_globals_ctor(compiler_globals, tsrm_ls); + if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) { + compiler_globals_ctor(compiler_globals, tsrm_ls); + compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list; + } else { + compiler_globals_ctor(compiler_globals, tsrm_ls); + } free(EG(zend_constants)); executor_globals_ctor(executor_globals, tsrm_ls); global_persistent_list = &EG(persistent_list);