diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-02 11:59:36 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-01-02 11:59:36 +0100 |
commit | e576d342bb8a4e8078a52383ed360acf00aefd39 (patch) | |
tree | c25876c370885f5d18764a91f2cb7419751e2ca8 | |
parent | 90fea675462252c668b8c0c8b5b94ece8d4f24a7 (diff) | |
download | php-git-e576d342bb8a4e8078a52383ed360acf00aefd39.tar.gz |
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.
-rw-r--r-- | ext/opcache/zend_persist.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |