File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ ZEND_API zend_coroutine_event_callback_t * zend_async_coroutine_callback_new(
444
444
445
445
static zend_always_inline zend_async_waker_trigger_t * waker_trigger_create (zend_async_event_t * event , uint32_t initial_capacity )
446
446
{
447
- size_t total_size = sizeof (zend_async_waker_trigger_t ) + initial_capacity * sizeof (zend_async_event_callback_t * );
447
+ size_t total_size = sizeof (zend_async_waker_trigger_t ) + ( initial_capacity - 1 ) * sizeof (zend_async_event_callback_t * );
448
448
zend_async_waker_trigger_t * trigger = (zend_async_waker_trigger_t * )emalloc (total_size );
449
449
450
450
trigger -> length = 0 ;
@@ -458,7 +458,7 @@ static zend_always_inline zend_async_waker_trigger_t *waker_trigger_add_callback
458
458
{
459
459
if (trigger -> length >= trigger -> capacity ) {
460
460
uint32_t new_capacity = trigger -> capacity * 2 ;
461
- size_t total_size = sizeof (zend_async_waker_trigger_t ) + new_capacity * sizeof (zend_async_event_callback_t * );
461
+ size_t total_size = sizeof (zend_async_waker_trigger_t ) + ( new_capacity - 1 ) * sizeof (zend_async_event_callback_t * );
462
462
463
463
zend_async_waker_trigger_t * new_trigger = (zend_async_waker_trigger_t * )erealloc (trigger , total_size );
464
464
new_trigger -> capacity = new_capacity ;
Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ struct _zend_async_waker_trigger_s {
421
421
uint32_t length ; /* current number of callbacks */
422
422
uint32_t capacity ; /* allocated slots in the array */
423
423
zend_async_event_t * event ;
424
- zend_async_event_callback_t * data []; /* flexible array member */
424
+ zend_async_event_callback_t * data [1 ]; /* flexible array member */
425
425
};
426
426
427
427
/* Dynamic array of async event callbacks with single iterator protection */
You can’t perform that action at this time.
0 commit comments