]> granicus.if.org Git - php/commitdiff
Functions must be stored with lowercase keys
authorDmitry Stogov <dmitry@zend.com>
Thu, 30 Nov 2017 12:59:29 +0000 (15:59 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 30 Nov 2017 12:59:29 +0000 (15:59 +0300)
ext/opcache/zend_accelerator_util_funcs.c

index 27e1a17f9226fb2813af6f12d401499d13ec0300..f2ac334e4762d3eb34eb2c65394083f8cf258876 100644 (file)
@@ -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));
 }