From bf98023f1af4316250c32244a98e9d3d31a39ded Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 29 Aug 2024 23:10:34 +0300 Subject: [PATCH] Prevent possible incorrect optimization caused by ZEND_ASSUME() --- ext/opcache/zend_shared_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 20854adcaaf..a7c7977066c 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -357,8 +357,6 @@ static size_t zend_shared_alloc_get_largest_free_block(void) void *zend_shared_alloc(size_t size) { - ZEND_ASSERT(ZCG(locked)); - int i; unsigned int block_size = ZEND_ALIGNED_SIZE(size); @@ -368,6 +366,7 @@ void *zend_shared_alloc(size_t size) #if 1 if (!ZCG(locked)) { + ZEND_ASSERT(0 && "Shared memory lock not obtained"); zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Shared memory lock not obtained"); } #endif