summaryrefslogtreecommitdiff
path: root/ext/opcache/ZendAccelerator.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2020-09-29 12:11:01 +0300
committerDmitry Stogov <dmitry@zend.com>2020-09-29 12:11:01 +0300
commit3928b6b435f6c7c818e8211b2ecdeeb7191310d1 (patch)
treef4ba91f2cae1ad66a71efb482bd6a697a68995f6 /ext/opcache/ZendAccelerator.c
parente08f69194c2b3e500549e5fbec631a22950ed186 (diff)
downloadphp-git-3928b6b435f6c7c818e8211b2ecdeeb7191310d1.tar.gz
Fixed unintended disabling of Optimizer for preloaded scripts introduced by 4a2646cf459
Diffstat (limited to 'ext/opcache/ZendAccelerator.c')
-rw-r--r--ext/opcache/ZendAccelerator.c5
1 files changed, 3 insertions, 2 deletions
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);
}