mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +01:00
Fix PHP-7.4+ build
This commit is contained in:
parent
1cb0668a63
commit
5a851173a3
7
php_uv.c
7
php_uv.c
@ -1386,7 +1386,11 @@ static int php_uv_do_callback3(zval *retval_ptr, php_uv_t *uv, zval *params, int
|
|||||||
uv->callback[type]->fcc.function_handler = &fn;
|
uv->callback[type]->fcc.function_handler = &fn;
|
||||||
|
|
||||||
ops = &fn.op_array;
|
ops = &fn.op_array;
|
||||||
|
#if PHP_VERSION_ID < 70400
|
||||||
ops->run_time_cache = NULL;
|
ops->run_time_cache = NULL;
|
||||||
|
#else
|
||||||
|
ZEND_MAP_PTR_SET(ops->run_time_cache, NULL);
|
||||||
|
#endif
|
||||||
if (ops->fn_flags) {
|
if (ops->fn_flags) {
|
||||||
ops->fn_flags &= ~ZEND_ACC_CLOSURE;
|
ops->fn_flags &= ~ZEND_ACC_CLOSURE;
|
||||||
ops->prototype = NULL;
|
ops->prototype = NULL;
|
||||||
@ -1400,9 +1404,12 @@ static int php_uv_do_callback3(zval *retval_ptr, php_uv_t *uv, zval *params, int
|
|||||||
error = -1;
|
error = -1;
|
||||||
} zend_end_try();
|
} zend_end_try();
|
||||||
|
|
||||||
|
// after PHP 7.4 this is arena allocated and automatically freed
|
||||||
|
#if PHP_VERSION_ID < 70400
|
||||||
if (ops->run_time_cache && !ops->function_name) {
|
if (ops->run_time_cache && !ops->function_name) {
|
||||||
efree(ops->run_time_cache);
|
efree(ops->run_time_cache);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uv->callback[type]->fcc.function_handler = old_fn;
|
uv->callback[type]->fcc.function_handler = old_fn;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user