Skip to content

Commit 9bb79ff

Browse files
committed
Use consumed_args for array_reduce and some other callback-using functions
1 parent 44dcd8a commit 9bb79ff

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

ext/pcre/php_pcre.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,6 +1570,7 @@ static zend_string *preg_do_repl_func(zend_fcall_info *fci, zend_fcall_info_cach
15701570
fci->retval = &retval;
15711571
fci->param_count = 1;
15721572
fci->params = &arg;
1573+
fci->consumed_args = ZEND_FCI_CONSUMED_ARG(0);
15731574
zend_call_function(fci, fcc);
15741575
zval_ptr_dtor(&arg);
15751576
if (EXPECTED(Z_TYPE(retval) == IS_STRING)) {

ext/standard/array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6409,6 +6409,7 @@ PHP_FUNCTION(array_reduce)
64096409
fci.retval = return_value;
64106410
fci.param_count = 2;
64116411
fci.params = args;
6412+
fci.consumed_args = ZEND_FCI_CONSUMED_ARG(0);
64126413

64136414
ZEND_HASH_FOREACH_VAL(htbl, operand) {
64146415
ZVAL_COPY_VALUE(&args[0], return_value);

main/output.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
972972
handler->func.user->fci.param_count = 2;
973973
handler->func.user->fci.params = ob_args;
974974
handler->func.user->fci.retval = &retval;
975+
handler->func.user->fci.consumed_args = ZEND_FCI_CONSUMED_ARG(0);
975976

976977
if (SUCCESS == zend_call_function(&handler->func.user->fci, &handler->func.user->fcc) && Z_TYPE(retval) != IS_UNDEF) {
977978
if (handler->flags & PHP_OUTPUT_HANDLER_PRODUCED_OUTPUT) {

0 commit comments

Comments
 (0)