[php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
| From: | ndossche | Date: | Thu, 22 Oct 2026 13:01:18 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142569@lists.php.net to get a copy of this message | ||
Author: ndossche (ndossche)
Date: 2026-10-22T15:00:51+02:00
Commit: https://github.com/php/php-src/commit/292db4946047d1e3088389e4972e7677cb5ed163
Raw diff: https://github.com/php/php-src/commit/292db4946047d1e3088389e4972e7677cb5ed163.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Tracing JIT: give the type guard on entry of an inlined call an exit opline
Changed paths:
A ext/opcache/tests/jit/gh24389.phpt
M NEWS
M ext/opcache/jit/zend_jit_trace.c
Diff:
diff --git a/NEWS b/NEWS
index 49a175ea82f4..a929d0aa5432 100644
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,8 @@ PHP NEWS
zend_jit_assign_dim_op()). (waroad)
. Fixed bug GH-24398 (JIT: minimal JIT segfault when a hooked property is
passed to a run-time-resolved function). (waroad)
+ . Fixed bug GH-24389 (Tracing JIT: type guard on entry of an inlined call
+ exits with an uninitialized opline). (waroad)
- PDO:
. Fixed invalid ATTR_ORACLE_NULLS values being accepted and truncated.
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index a950581ea77b..29e7ffa3ad88 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -6963,7 +6963,7 @@ static zend_vm_opcode_handler_t zend_jit_trace(zend_jit_trace_rec
*trace_buffer,
ssa->var_info[j].type &= ~MAY_BE_GUARD;
op_type = concrete_type(ssa->var_info[j].type);
- if (!zend_jit_type_guard(&ctx, NULL, EX_NUM_TO_VAR(i), op_type)) {
+ if (!zend_jit_type_guard(&ctx, (p+1)->opline, EX_NUM_TO_VAR(i), op_type)) {
goto jit_failure;
}
SET_STACK_TYPE(stack, i, op_type, 1);
diff --git a/ext/opcache/tests/jit/gh24389.phpt b/ext/opcache/tests/jit/gh24389.phpt
new file mode 100644
index 000000000000..8c8d5725f614
--- /dev/null
+++ b/ext/opcache/tests/jit/gh24389.phpt
@@ -0,0 +1,30 @@
+--TEST--
+GH-24389 (Tracing JIT: type guard on entry of an inlined call exits with an uninitialized opline)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.file_update_protection=0
+opcache.jit_buffer_size=64M
+opcache.jit=tracing
+--EXTENSIONS--
+opcache
+--FILE--
+<?php
+function right($x, $y) {
+ $a = $x + $y;
+ return $x - $y;
+}
+function driver($x, $y) {
+ $xr = &$x;
+ $yr = &$y;
+ for ($i = 0; $i < 300; $i++) {
+ $r = right($x, $y);
+ }
+ return $r;
+}
+var_dump(driver(3, 2));
+var_dump(driver(3.5, 2.5));
+?>
+--EXPECT--
+int(1)
+float(1)