Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3754,6 +3754,10 @@ static void _zend_jit_fix_merges(zend_jit_ctx *jit)
if (k != n) {
ir_ref n2, k2;

while (r != q) {
*r = IR_UNUSED;
r++;
}
if (k <= 1) {
insn->op = IR_BEGIN;
insn->inputs_count = 0;
Expand Down
23 changes: 23 additions & 0 deletions ext/opcache/tests/jit/gh24397.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--TEST--
GH-24397 (JIT: stale label operand on a MERGE reduced to BEGIN)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=64M
opcache.jit=function
opcache.jit_debug=0x1000000
--EXTENSIONS--
opcache
--FILE--
<?php
function f() {
foreach ([1, 2] as $v) {
$c[] = $v;
}
}
f();
echo "Done\n";
?>
--EXPECTF--
%ADone
Loading