mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix static variables in main script with file cache
If the script will be cached in SHM (!corrupted), then we cannot allocate the static variables on the arena. Instead do the same thing we do during normal persistence and allocate a map ptr slot.
This commit is contained in:
parent
7159907d30
commit
f1ce44d1cb
1 changed files with 8 additions and 6 deletions
|
@ -1244,15 +1244,17 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
|
|||
zend_persistent_script *script,
|
||||
void *buf)
|
||||
{
|
||||
if (!(script->corrupted)
|
||||
&& op_array != &script->script.main_op_array) {
|
||||
op_array->fn_flags |= ZEND_ACC_IMMUTABLE;
|
||||
if (!script->corrupted) {
|
||||
if (op_array != &script->script.main_op_array) {
|
||||
op_array->fn_flags |= ZEND_ACC_IMMUTABLE;
|
||||
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
|
||||
} else {
|
||||
ZEND_ASSERT(!(op_array->fn_flags & ZEND_ACC_IMMUTABLE));
|
||||
ZEND_MAP_PTR_INIT(op_array->run_time_cache, NULL);
|
||||
}
|
||||
if (op_array->static_variables) {
|
||||
ZEND_MAP_PTR_NEW(op_array->static_variables_ptr);
|
||||
} else {
|
||||
ZEND_MAP_PTR_INIT(op_array->static_variables_ptr, NULL);
|
||||
}
|
||||
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
|
||||
} else {
|
||||
op_array->fn_flags &= ~ZEND_ACC_IMMUTABLE;
|
||||
if (op_array->static_variables) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue