Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix file cache run_time_cache unserialization
  Update ZCSG(map_ptr_last) only if for_shm
This commit is contained in:
Nikita Popov 2020-01-02 15:01:56 +01:00
commit 3bc4159a19
2 changed files with 12 additions and 2 deletions

View file

@ -1282,7 +1282,15 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
} else {
ZEND_MAP_PTR_INIT(op_array->static_variables_ptr, &op_array->static_variables);
UNSERIALIZE_PTR(ZEND_MAP_PTR(op_array->run_time_cache));
if (ZEND_MAP_PTR(op_array->run_time_cache)) {
if (script->corrupted) {
/* Not in SHM: Use serialized arena pointer. */
UNSERIALIZE_PTR(ZEND_MAP_PTR(op_array->run_time_cache));
} else {
/* In SHM: Allocate new pointer. */
ZEND_MAP_PTR_NEW(op_array->run_time_cache);
}
}
}
}
}

View file

@ -1138,7 +1138,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
} ZEND_HASH_FOREACH_END();
zend_persist_op_array_ex(&script->script.main_op_array, script);
ZCSG(map_ptr_last) = CG(map_ptr_last);
if (for_shm) {
ZCSG(map_ptr_last) = CG(map_ptr_last);
}
#ifdef HAVE_JIT
if (ZCG(jit_enabled) && for_shm) {