From: Dmitry Stogov Date: Tue, 29 Sep 2020 09:11:01 +0000 (+0300) Subject: Fixed unintended disabling of Optimizer for preloaded scripts introduced by 4a2646cf459 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3928b6b435f6c7c818e8211b2ecdeeb7191310d1;p=php Fixed unintended disabling of Optimizer for preloaded scripts introduced by 4a2646cf459 --- diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index b9a0946a56..3da1a5492e 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4078,6 +4078,7 @@ static void preload_fix_trait_methods(zend_class_entry *ce) static int preload_optimize(zend_persistent_script *script) { zend_class_entry *ce; + zend_persistent_script *tmp_script; zend_shared_alloc_init_xlat_table(); @@ -4087,8 +4088,8 @@ static int preload_optimize(zend_persistent_script *script) } } ZEND_HASH_FOREACH_END(); - ZEND_HASH_FOREACH_PTR(preload_scripts, script) { - ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) { + ZEND_HASH_FOREACH_PTR(preload_scripts, tmp_script) { + ZEND_HASH_FOREACH_PTR(&tmp_script->script.class_table, ce) { if (ce->ce_flags & ZEND_ACC_TRAIT) { preload_register_trait_methods(ce); }