com php-src: Fixed bug #70108 sometimes empty $_SERVER[ 'QUERY_STRING']: Zend/zend.c

From: Date: Fri, 31 Jul 2015 11:32:39 +0000
Subject: com php-src: Fixed bug #70108 sometimes empty $_SERVER[ 'QUERY_STRING']: Zend/zend.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-88253@lists.php.net to get a copy of this message
Commit: b604716fb6fccfcbaafc8ecf46d1cf5ddb6c715c Author: Anatol Belski <ab@php.net> Fri, 31 Jul 2015 13:22:24 +0200 Parents: 590c5a7e501bec91c4f57813d167e870653f2451 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b604716fb6fccfcbaafc8ecf46d1cf5ddb6c715c Log: Fixed bug #70108 sometimes empty $_SERVER['QUERY_STRING'] auto_globals_jit is the reason every thread needs a copy.. Otherwise every thread will operate on the master values which can't end good. Bugs: https://bugs.php.net/70108 Changed paths: M Zend/zend.c Diff: diff --git a/Zend/zend.c b/Zend/zend.c index 1686586..b1290f7 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -455,6 +455,18 @@ static void function_copy_ctor(zval *zv) function_add_ref(Z_FUNC_P(zv)); } +static void auto_global_copy_ctor(zval *zv) +{ + zend_auto_global *old_ag = (zend_auto_global *) Z_PTR_P(zv); + zend_auto_global *new_ag = pemalloc(sizeof(zend_auto_global), 1); + + new_ag->name = zend_string_copy(old_ag->name); + new_ag->auto_global_callback = old_ag->auto_global_callback; + new_ag->jit = old_ag->jit; + + Z_PTR_P(zv) = new_ag; +} + static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{{ */ { compiler_globals->compiled_filename = NULL; @@ -471,7 +483,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{ compiler_globals->auto_globals = (HashTable *) malloc(sizeof(HashTable)); zend_hash_init_ex(compiler_globals->auto_globals, 8, NULL, NULL, 1, 0); - zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, NULL /* empty element */); + zend_hash_copy(compiler_globals->auto_globals, global_auto_globals_table, auto_global_copy_ctor); compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table); if (compiler_globals->last_static_member) {

« previous php.cvs (#88253) next »