summaryrefslogtreecommitdiff
path: root/ext/opcache/ZendAccelerator.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-08-04 20:20:12 +0400
committerDmitry Stogov <dmitry@zend.com>2014-08-04 20:20:12 +0400
commit415482ac0abfbad8fa1416b2048a91d2e0ff2d4a (patch)
treef346fb342d7d3a34cdc36a35c002818bd3d0873f /ext/opcache/ZendAccelerator.c
parent7301994c28d548c5a4eda6a3a4ae0fab6af04636 (diff)
downloadphp-git-415482ac0abfbad8fa1416b2048a91d2e0ff2d4a.tar.gz
Delete immutable arrays copied into SHM (related to bug #67725)
Diffstat (limited to 'ext/opcache/ZendAccelerator.c')
-rw-r--r--ext/opcache/ZendAccelerator.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index df36b55b62..4053b72499 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -1650,6 +1650,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
/* If script was not found or invalidated by validate_timestamps */
if (!persistent_script) {
+ zend_uint old_const_num = zend_hash_next_free_element(EG(zend_constants));
zend_op_array *op_array;
/* Cache miss.. */
@@ -1674,6 +1675,14 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type T
SHM_PROTECT();
return op_array;
}
+ if (from_shared_memory) {
+ /* Delete immutable arrays moved into SHM */
+ zend_uint new_const_num = zend_hash_next_free_element(EG(zend_constants));
+ while (new_const_num > old_const_num) {
+ new_const_num--;
+ zend_hash_index_del(EG(zend_constants), new_const_num);
+ }
+ }
} else {
#if !ZEND_WIN32