Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed unintended disabling of Optimizer for preloaded scripts introduced by 4a2646cf45
This commit is contained in:
Dmitry Stogov 2020-09-29 12:13:17 +03:00
commit 8d9da8df28

View file

@ -4160,6 +4160,7 @@ static void preload_fix_trait_methods(zend_class_entry *ce)
static int preload_optimize(zend_persistent_script *script) static int preload_optimize(zend_persistent_script *script)
{ {
zend_class_entry *ce; zend_class_entry *ce;
zend_persistent_script *tmp_script;
zend_shared_alloc_init_xlat_table(); zend_shared_alloc_init_xlat_table();
@ -4169,8 +4170,8 @@ static int preload_optimize(zend_persistent_script *script)
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
ZEND_HASH_FOREACH_PTR(preload_scripts, script) { ZEND_HASH_FOREACH_PTR(preload_scripts, tmp_script) {
ZEND_HASH_FOREACH_PTR(&script->script.class_table, ce) { ZEND_HASH_FOREACH_PTR(&tmp_script->script.class_table, ce) {
if (ce->ce_flags & ZEND_ACC_TRAIT) { if (ce->ce_flags & ZEND_ACC_TRAIT) {
preload_register_trait_methods(ce); preload_register_trait_methods(ce);
} }