From e576d342bb8a4e8078a52383ed360acf00aefd39 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 2 Jan 2020 11:59:36 +0100 Subject: Update ZCSG(map_ptr_last) only if for_shm Otherwise we may get a memory protection fault here. Updating of ZCSG(map_ptr_last) is handled when loading from file cache to SHM. --- ext/opcache/zend_persist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 06d103d670..dd4c199ef7 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -1089,7 +1089,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); + } script->corrupted = 0; ZCG(current_persistent_script) = NULL; -- cgit v1.2.1