summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_shared_alloc.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2019-04-11 15:42:22 +0200
committerAnatol Belski <ab@php.net>2019-04-11 15:46:46 +0200
commitf4628436df9492cd00465ba1f29d3c71dded17cc (patch)
treeaf35bf6c57d4eb2e688a65546aa5485716b34a15 /ext/opcache/zend_shared_alloc.c
parent771c64edcced24c6134bcfea3546e86a4e30e3c7 (diff)
downloadphp-git-f4628436df9492cd00465ba1f29d3c71dded17cc.tar.gz
Fix VirtualProtect memory size
As otherwise it would remove executable flag from JIT memory Thanks Dmitry for the hint :)
Diffstat (limited to 'ext/opcache/zend_shared_alloc.c')
-rw-r--r--ext/opcache/zend_shared_alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index ade01af4f5..1ab7f774ed 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -626,7 +626,7 @@ void zend_accel_shared_protect(int mode)
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
DWORD oldProtect;
- if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->size, mode, &oldProtect)) {
+ if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode, &oldProtect)) {
zend_accel_error(ACCEL_LOG_ERROR, "Failed to protect memory");
}
}