diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 06d103d6704..dd4c199ef76 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;