From: Nikita Popov Date: Wed, 20 Mar 2019 11:07:05 +0000 (+0100) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8971728383e77cfb646559b744b65383a95b6108;p=php Merge branch 'PHP-7.4' --- 8971728383e77cfb646559b744b65383a95b6108 diff --cc Zend/zend_API.c index ad15a38cf6,881ee27a03..00161da07e --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@@ -2792,10 -2907,13 +2792,10 @@@ static int zend_is_callable_check_class } /* }}} */ - static void free_fcc(zend_fcall_info_cache *fcc) { + ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc) { if (fcc->function_handler && - ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION && - fcc->function_handler->common.function_name) { + (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) { + if (fcc->function_handler->common.function_name) { zend_string_release_ex(fcc->function_handler->common.function_name, 0); } zend_free_trampoline(fcc->function_handler); @@@ -3208,10 -3350,10 +3209,10 @@@ check_func } return 0; case IS_OBJECT: - if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(callable, &fcc->calling_scope, &fcc->function_handler, &fcc->object) == SUCCESS) { + if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(Z_OBJ_P(callable), &fcc->calling_scope, &fcc->function_handler, &fcc->object) == SUCCESS) { fcc->called_scope = fcc->calling_scope; if (fcc == &fcc_local) { - free_fcc(fcc); + zend_release_fcall_info_cache(fcc); } return 1; } diff --cc Zend/zend_API.h index 04cd0fbf3c,00a39f6624..30b24d10af --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@@ -297,8 -297,12 +297,9 @@@ ZEND_API ZEND_COLD void zend_wrong_para #define IS_CALLABLE_CHECK_SYNTAX_ONLY (1<<0) #define IS_CALLABLE_CHECK_NO_ACCESS (1<<1) -#define IS_CALLABLE_CHECK_IS_STATIC (1<<2) #define IS_CALLABLE_CHECK_SILENT (1<<3) -#define IS_CALLABLE_STRICT (IS_CALLABLE_CHECK_IS_STATIC) - + ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object); ZEND_API zend_string *zend_get_callable_name(zval *callable); ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error);