Skip to content

Commit 62a9f97

Browse files
committed
Move preload_autoload assignment into preload_load()
We need to set the preload autoloader even if preloading happened in a different process. accel_preload() will only run in one. In particular, this fixes the behavior if preload_user is used.
1 parent 6bc7370 commit 62a9f97

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4311,6 +4311,8 @@ static zend_persistent_script* preload_script_in_shared_memory(zend_persistent_s
43114311
return new_persistent_script;
43124312
}
43134313

4314+
static zend_result preload_autoload(zend_string *filename);
4315+
43144316
static void preload_load(void)
43154317
{
43164318
/* Load into process tables */
@@ -4354,6 +4356,8 @@ static void preload_load(void)
43544356
memset((void **) ZEND_MAP_PTR_REAL_BASE(CG(map_ptr_base)) + old_map_ptr_last, 0,
43554357
(CG(map_ptr_last) - old_map_ptr_last) * sizeof(void *));
43564358
}
4359+
4360+
zend_preload_autoload = preload_autoload;
43574361
}
43584362

43594363
static zend_result preload_autoload(zend_string *filename)
@@ -4733,8 +4737,6 @@ static int accel_preload(const char *config, zend_bool in_child)
47334737
HANDLE_UNBLOCK_INTERRUPTIONS();
47344738

47354739
zend_shared_alloc_destroy_xlat_table();
4736-
4737-
zend_preload_autoload = preload_autoload;
47384740
} else {
47394741
CG(map_ptr_last) = orig_map_ptr_last;
47404742
}

0 commit comments

Comments
 (0)