Skip to content

Commit

Permalink
Update ZCSG(map_ptr_last) only if for_shm
Browse files Browse the repository at this point in the history
Otherwise we may get a memory protection fault here. Updating of
ZCSG(map_ptr_last) is handled when loading from file cache to SHM.
  • Loading branch information
nikic committed Jan 2, 2020
1 parent 90fea67 commit e576d34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/opcache/zend_persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e576d34

Please sign in to comment.