@@ -1794,9 +1794,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
1794
1794
Z_PARAM_DOUBLE_EX(dest, is_null, 1, 0)
1795
1795
1796
1796
/* old "f" */
1797
- #define Z_PARAM_FUNC_EX (dest_fci , dest_fcc , check_null , deref ) \
1797
+ #define Z_PARAM_FUNC_EX (dest_fci , dest_fcc , check_null , deref , free_trampoline ) \
1798
1798
Z_PARAM_PROLOGUE(deref, 0); \
1799
- if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \
1799
+ if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error, free_trampoline ))) { \
1800
1800
if (!_error) { \
1801
1801
_expected_type = check_null ? Z_EXPECTED_FUNC_OR_NULL : Z_EXPECTED_FUNC; \
1802
1802
_error_code = ZPP_ERROR_WRONG_ARG; \
@@ -1807,13 +1807,19 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
1807
1807
} \
1808
1808
1809
1809
#define Z_PARAM_FUNC (dest_fci , dest_fcc ) \
1810
- Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0)
1810
+ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0, true)
1811
+
1812
+ #define Z_PARAM_FUNC_NO_TRAMPOLINE_FREE (dest_fci , dest_fcc ) \
1813
+ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0, false)
1811
1814
1812
1815
#define Z_PARAM_FUNC_OR_NULL (dest_fci , dest_fcc ) \
1813
- Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0)
1816
+ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0, true)
1817
+
1818
+ #define Z_PARAM_FUNC_NO_TRAMPOLINE_FREE_OR_NULL (dest_fci , dest_fcc ) \
1819
+ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0, false)
1814
1820
1815
1821
#define Z_PARAM_FUNC_OR_NULL_WITH_ZVAL (dest_fci , dest_fcc , dest_zp ) \
1816
- Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0) \
1822
+ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0, true ) \
1817
1823
Z_PARAM_GET_PREV_ZVAL(dest_zp)
1818
1824
1819
1825
/* old "h" */
@@ -2428,7 +2434,7 @@ static zend_always_inline bool zend_parse_arg_resource(zval *arg, zval **dest, b
2428
2434
return 1 ;
2429
2435
}
2430
2436
2431
- static zend_always_inline bool zend_parse_arg_func (zval * arg , zend_fcall_info * dest_fci , zend_fcall_info_cache * dest_fcc , bool check_null , char * * error )
2437
+ static zend_always_inline bool zend_parse_arg_func (zval * arg , zend_fcall_info * dest_fci , zend_fcall_info_cache * dest_fcc , bool check_null , char * * error , bool free_trampoline )
2432
2438
{
2433
2439
if (check_null && UNEXPECTED (Z_TYPE_P (arg ) == IS_NULL )) {
2434
2440
dest_fci -> size = 0 ;
@@ -2437,10 +2443,12 @@ static zend_always_inline bool zend_parse_arg_func(zval *arg, zend_fcall_info *d
2437
2443
} else if (UNEXPECTED (zend_fcall_info_init (arg , 0 , dest_fci , dest_fcc , NULL , error ) != SUCCESS )) {
2438
2444
return 0 ;
2439
2445
}
2440
- /* Release call trampolines: The function may not get called, in which case
2441
- * the trampoline will leak. Force it to be refetched during
2442
- * zend_call_function instead. */
2443
- zend_release_fcall_info_cache (dest_fcc );
2446
+ if (free_trampoline ) {
2447
+ /* Release call trampolines: The function may not get called, in which case
2448
+ * the trampoline will leak. Force it to be refetched during
2449
+ * zend_call_function instead. */
2450
+ zend_release_fcall_info_cache (dest_fcc );
2451
+ }
2444
2452
return 1 ;
2445
2453
}
2446
2454
0 commit comments