Skip to content

Commit 345ac90

Browse files
authored
Introduce Z_PARAM_FUNC_EX2 to maintain compatibility (#12419)
Commit d863149 added an additional parameter to Z_PARAM_FUNC_EX. To maintain compatibility with third-party extensions, we keep Z_PARAM_FUNC_EX as it used to be, and add Z_PARAM_FUNC_EX2 instead.
1 parent 0ba24a5 commit 345ac90

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

UPGRADING.INTERNALS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ PHP 8.4 INTERNALS UPGRADE NOTES
2323
This is identical to the 'f' or Z_PARAM_FUNC type check, except the FCC is
2424
always initialized because it doesn't free trampolines.
2525
Trampolines MUST be freed using zend_release_fcall_info_cache() or consumed.
26+
Z_PARAM_FUNC_EX2 was added as well with the same arguments as Z_PARAM_FUNC_EX
27+
plus an additional argument free_trampoline.
2628

2729
========================
2830
2. Build system changes

Zend/zend_API.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
17941794
Z_PARAM_DOUBLE_EX(dest, is_null, 1, 0)
17951795

17961796
/* old "f" */
1797-
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, deref, free_trampoline) \
1797+
#define Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, deref, free_trampoline) \
17981798
Z_PARAM_PROLOGUE(deref, 0); \
17991799
if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error, free_trampoline))) { \
18001800
if (!_error) { \
@@ -1806,20 +1806,22 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
18061806
break; \
18071807
} \
18081808

1809+
#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, deref) Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, deref, true)
1810+
18091811
#define Z_PARAM_FUNC(dest_fci, dest_fcc) \
1810-
Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0, true)
1812+
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, 0, 0, true)
18111813

18121814
#define Z_PARAM_FUNC_NO_TRAMPOLINE_FREE(dest_fci, dest_fcc) \
1813-
Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0, false)
1815+
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, 0, 0, false)
18141816

18151817
#define Z_PARAM_FUNC_OR_NULL(dest_fci, dest_fcc) \
1816-
Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0, true)
1818+
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, 1, 0, true)
18171819

18181820
#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)
1821+
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, 1, 0, false)
18201822

18211823
#define Z_PARAM_FUNC_OR_NULL_WITH_ZVAL(dest_fci, dest_fcc, dest_zp) \
1822-
Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 1, 0, true) \
1824+
Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, 1, 0, true) \
18231825
Z_PARAM_GET_PREV_ZVAL(dest_zp)
18241826

18251827
/* old "h" */

0 commit comments

Comments
 (0)