Skip to content

Commit bf98023

Browse files
committed
Prevent possible incorrect optimization caused by ZEND_ASSUME()
1 parent c15bb9a commit bf98023

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/opcache/zend_shared_alloc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ static size_t zend_shared_alloc_get_largest_free_block(void)
357357

358358
void *zend_shared_alloc(size_t size)
359359
{
360-
ZEND_ASSERT(ZCG(locked));
361-
362360
int i;
363361
unsigned int block_size = ZEND_ALIGNED_SIZE(size);
364362

@@ -368,6 +366,7 @@ void *zend_shared_alloc(size_t size)
368366

369367
#if 1
370368
if (!ZCG(locked)) {
369+
ZEND_ASSERT(0 && "Shared memory lock not obtained");
371370
zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Shared memory lock not obtained");
372371
}
373372
#endif

0 commit comments

Comments
 (0)