com php-src: Functions must be stored with lowercase keys: ext/opcache/zend_accelerator_util_funcs.c

From: Date: Thu, 30 Nov 2017 12:59:29 +0000
Subject: com php-src: Functions must be stored with lowercase keys: ext/opcache/zend_accelerator_util_funcs.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-100453@lists.php.net to get a copy of this message
Commit: 245422653c97cd1fb6bcd6de725574b37b4b639b Author: Dmitry Stogov <dmitry@zend.com> Thu, 30 Nov 2017 15:59:29 +0300 Parents: 821bdbdfba3d45066b45d506d62b4fb6ab44287b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=245422653c97cd1fb6bcd6de725574b37b4b639b Log: Functions must be stored with lowercase keys Changed paths: M ext/opcache/zend_accelerator_util_funcs.c Diff: diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 27e1a17..f2ac334 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -135,18 +135,17 @@ void zend_accel_move_user_functions(HashTable *src, HashTable *dst) src->pDestructor = orig_dtor; } -static int copy_internal_function(zval *zv, HashTable *function_table) -{ - zend_internal_function *function = Z_PTR_P(zv); - if (function->type == ZEND_INTERNAL_FUNCTION) { - zend_hash_update_mem(function_table, function->function_name, function, sizeof(zend_internal_function)); - } - return 0; -} - void zend_accel_copy_internal_functions(void) { - zend_hash_apply_with_argument(CG(function_table), (apply_func_arg_t)copy_internal_function, &ZCG(function_table)); + zend_string *key; + zval *val; + + ZEND_HASH_FOREACH_STR_KEY_VAL(CG(function_table), key, val) { + zend_internal_function *function = Z_PTR_P(val); + if (function->type == ZEND_INTERNAL_FUNCTION) { + zend_hash_update_mem(&ZCG(function_table), key, function, sizeof(zend_internal_function)); + } + } ZEND_HASH_FOREACH_END(); ZCG(internal_functions_count) = zend_hash_num_elements(&ZCG(function_table)); }

« previous php.cvs (#100453) next »