[php-src] master: Merge branch 'PHP-8.6'

From: Date: Fri, 02 Oct 2026 20:53:17 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141901@lists.php.net to get a copy of this message
Author: ndossche (ndossche) Date: 2026-10-02T22:53:04+02:00 Commit: https://github.com/php/php-src/commit/56afe82cbbe61d72bd94fda0bd4abda380135ea1 Raw diff: https://github.com/php/php-src/commit/56afe82cbbe61d72bd94fda0bd4abda380135ea1.diff Merge branch 'PHP-8.6' * PHP-8.6: Fix GH-23991: JIT generates invalid IR for multiple recursive calls Changed paths: A ext/opcache/tests/jit/gh23991.phpt M ext/opcache/jit/zend_jit_ir.c Diff: diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 9ea95627907b..966fe68f3897 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -10440,14 +10440,6 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen insn->inputs_count = 3; insn->op3 = end; break; - } else if (insn->op == IR_LOOP_BEGIN && insn->inputs_count == 3) { - ZEND_ASSERT(jit->ctx.ir_base[insn->op3].op == IR_LOOP_END); - jit->ctx.ir_base[insn->op3].op = IR_END; - ir_MERGE_2(insn->op3, ir_END()); - end = ir_LOOP_END(); - insn = &jit->ctx.ir_base[begin]; - insn->op3 = end; - break; } } /* fallback to indirect JMP or RETURN */ diff --git a/ext/opcache/tests/jit/gh23991.phpt b/ext/opcache/tests/jit/gh23991.phpt new file mode 100644 index 000000000000..21c072793621 --- /dev/null +++ b/ext/opcache/tests/jit/gh23991.phpt @@ -0,0 +1,36 @@ +--TEST-- +GH-23991 (JIT generates invalid IR for multiple recursive calls converted into loop) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit_buffer_size=64M +opcache.jit=1235 +opcache.jit_hot_func=1 +--EXTENSIONS-- +opcache +--FILE-- +<?php +function f($value, $recurse, $param = '') { + if (is_array($value)) { + if ($recurse) { + foreach ($value as $k => $v) { + $value[$k] = f($v, $recurse, $param); + } + } + foreach ($value as $k => $v) { + if ($undef) { + $value[$k] = f($v, $recurse, $param); + } + } + } + return $value; +} +var_dump(f([[]], true)); +?> +--EXPECTF-- +Warning: Undefined variable $undef in %s on line %d +array(1) { + [0]=> + array(0) { + } +}

« previous php.cvs (#141901) next »