From ec7d772b196387e41d59a8bba3f14cd831dda467 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Fri, 9 Oct 2026 21:49:59 +0200 Subject: [PATCH] Add regression test for GH-16821 --- ext/opcache/tests/jit/gh16821.phpt | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ext/opcache/tests/jit/gh16821.phpt diff --git a/ext/opcache/tests/jit/gh16821.phpt b/ext/opcache/tests/jit/gh16821.phpt new file mode 100644 index 000000000000..5aacaeee41a3 --- /dev/null +++ b/ext/opcache/tests/jit/gh16821.phpt @@ -0,0 +1,63 @@ +--TEST-- +GH-16821 (Spill conflict between ASSIGN.op1_def and ASSIGN.op2_use) +--EXTENSIONS-- +opcache +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit=tracing +opcache.jit_buffer_size=64M +opcache.jit_hot_loop=1 +opcache.jit_hot_func=1 +opcache.jit_hot_return=1 +opcache.jit_hot_side_exit=1 +--FILE-- += 571;) { + $g = $h >> 3; + for ($mask = 0x80; $mask > 0; $mask >>= 1, $i--, $h++) { + if (ord($c[$g]) & $mask) { + $temp = $i - 571; + $j = $temp >> 3; + $t1 = $j ? substr($c, 0, -$j) : $c; + $length = strlen($t1); + $temp = $t1 ^ str_pad($u, $length, "\0", STR_PAD_LEFT); + $c = substr_replace($c, $temp, 0, $length); + } + } + } + return $c; +} + +var_dump(md5(reduce(str_repeat("\xff", 72), "\x04\x25"))); +?> +--EXPECT-- +string(32) "dd12a5bb6e3d7b4abcdd92e135850169" +