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.
This commit is contained in:
Nikita Popov committed 2020-01-02 11:59:36 +01:00
1 parent 90fea67546
commit e576d342bb
1 file changed
+3 -1
+3 -1
View File
@@ -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;