Free two bits in fn_flags by merging ZEND_ACC_HEAP_RT_CACHE/ZEND_ACC_USER_ARG_INFO and ZEND_ACC_DONE_PASS_TWO/ZEND_ACC_ARENA_ALLOCATED that may be used only for user/internal functions

This commit is contained in:
Dmitry Stogov 2019-09-02 14:05:28 +03:00
parent e6d3a218f0
commit c739023a50
4 changed files with 9 additions and 7 deletions

View file

@ -183,7 +183,8 @@ ZEND_METHOD(Closure, call)
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
/* copied upon generator creation */
GC_DELREF(&closure->std);
} else if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
} else if (ZEND_USER_CODE(my_function.type)
&& fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
}
}

View file

@ -278,7 +278,7 @@ typedef struct _zend_oparray_context {
/* Class has unresolved variance obligations. | | | */
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
/* | | | */
/* Function Flags | | | */
/* Function Flags (unused: 23, 26) | | | */
/* ============== | | | */
/* | | | */
/* deprecation flag | | | */
@ -318,15 +318,16 @@ typedef struct _zend_oparray_context {
/* run_time_cache allocated on heap (user only) | | | */
#define ZEND_ACC_HEAP_RT_CACHE (1 << 22) /* | X | | */
/* | | | */
/* method flag used by Closure::__invoke() | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 23) /* | X | | */
/* method flag used by Closure::__invoke() (int only) | | | */
#define ZEND_ACC_USER_ARG_INFO (1 << 22) /* | X | | */
/* | | | */
#define ZEND_ACC_GENERATOR (1 << 24) /* | X | | */
/* | | | */
/* function was processed by pass two (user only) | | | */
#define ZEND_ACC_DONE_PASS_TWO (1 << 25) /* | X | | */
/* | | | */
/* internal function is allocated at arena (int only) | | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 26) /* | X | | */
#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */
/* | | | */
/* op_array is a clone of trait method | | | */
#define ZEND_ACC_TRAIT_CLONE (1 << 27) /* | X | | */

View file

@ -44,7 +44,7 @@ You can use the following macro to check the extension API version for compatibi
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no.. */
#define ZEND_EXTENSION_API_NO 320190529
#define ZEND_EXTENSION_API_NO 320190902
typedef struct _zend_extension_version_info {
int zend_extension_api_no;

View file

@ -31,7 +31,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module
#define ZEND_MODULE_API_NO 20190529
#define ZEND_MODULE_API_NO 20190902
#ifdef ZTS
#define USING_ZTS 1
#else