Skip to content

Commit e576d34

Browse files
committed
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.
1 parent 90fea67 commit e576d34

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/opcache/zend_persist.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@ zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script
10891089
} ZEND_HASH_FOREACH_END();
10901090
zend_persist_op_array_ex(&script->script.main_op_array, script);
10911091

1092-
ZCSG(map_ptr_last) = CG(map_ptr_last);
1092+
if (for_shm) {
1093+
ZCSG(map_ptr_last) = CG(map_ptr_last);
1094+
}
10931095

10941096
script->corrupted = 0;
10951097
ZCG(current_persistent_script) = NULL;

0 commit comments

Comments
 (0)