Skip to content

Commit 33e10fe

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: 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
2 parents 633c588 + c739023 commit 33e10fe

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Zend/zend_closures.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ ZEND_METHOD(Closure, call)
179179
if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_GENERATOR) {
180180
/* copied upon generator creation */
181181
GC_DELREF(&closure->std);
182-
} else if (fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
182+
} else if (ZEND_USER_CODE(my_function.type)
183+
&& fci_cache.function_handler->common.fn_flags & ZEND_ACC_HEAP_RT_CACHE) {
183184
efree(ZEND_MAP_PTR(my_function.op_array.run_time_cache));
184185
}
185186
}

Zend/zend_compile.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ typedef struct _zend_oparray_context {
278278
/* Class has unresolved variance obligations. | | | */
279279
#define ZEND_ACC_UNRESOLVED_VARIANCE (1 << 21) /* X | | | */
280280
/* | | | */
281-
/* Function Flags | | | */
281+
/* Function Flags (unused: 17, 23, 26) | | | */
282282
/* ============== | | | */
283283
/* | | | */
284284
/* deprecation flag | | | */
@@ -314,15 +314,16 @@ typedef struct _zend_oparray_context {
314314
/* run_time_cache allocated on heap (user only) | | | */
315315
#define ZEND_ACC_HEAP_RT_CACHE (1 << 22) /* | X | | */
316316
/* | | | */
317-
/* method flag used by Closure::__invoke() | | | */
318-
#define ZEND_ACC_USER_ARG_INFO (1 << 23) /* | X | | */
317+
/* method flag used by Closure::__invoke() (int only) | | | */
318+
#define ZEND_ACC_USER_ARG_INFO (1 << 22) /* | X | | */
319319
/* | | | */
320320
#define ZEND_ACC_GENERATOR (1 << 24) /* | X | | */
321321
/* | | | */
322+
/* function was processed by pass two (user only) | | | */
322323
#define ZEND_ACC_DONE_PASS_TWO (1 << 25) /* | X | | */
323324
/* | | | */
324325
/* internal function is allocated at arena (int only) | | | */
325-
#define ZEND_ACC_ARENA_ALLOCATED (1 << 26) /* | X | | */
326+
#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */
326327
/* | | | */
327328
/* op_array is a clone of trait method | | | */
328329
#define ZEND_ACC_TRAIT_CLONE (1 << 27) /* | X | | */

0 commit comments

Comments
 (0)