diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 3d4a9f8c687..2c6f14f9ea5 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -71,7 +71,7 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption) return FAILURE; } if (UNEXPECTED(memsize > ZEND_LONG_MAX / (1024 * 1024))) { - *p = ZEND_LONG_MAX; + *p = ZEND_LONG_MAX & ~(1024 * 1024 - 1); } else { *p = memsize * (1024 * 1024); }