Fix VirtualProtect memory size

As otherwise it would remove executable flag from JIT memory

Thanks Dmitry for the hint :)
This commit is contained in:
Anatol Belski 2019-04-11 15:42:22 +02:00
parent 771c64edcc
commit f4628436df

View file

@ -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");
}
}