[php-src] master: Merge branch 'PHP-8.5' into PHP-8.6
| From: | ndossche | Date: | Wed, 25 Nov 2026 18:16:57 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.5' into PHP-8.6 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-144173@lists.php.net to get a copy of this message | ||
Author: ndossche (ndossche)
Date: 2026-11-25T19:16:37+01:00
Commit: https://github.com/php/php-src/commit/7ce005bd759ac2c870827db848bfa0a90aa3ce48
Raw diff: https://github.com/php/php-src/commit/7ce005bd759ac2c870827db848bfa0a90aa3ce48.diff
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
Fix OSS-Fuzz #588264417
Changed paths:
A ext/opcache/tests/jit/assign_dim_028.phpt
M NEWS
M ext/opcache/jit/zend_jit_ir.c
Diff:
diff --git a/NEWS b/NEWS
index 4ac9fa5c5104..04b58161157b 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,7 @@ PHP NEWS
(mihaliak)
. Fixed bug GH-25379 (array_map() foreach optimization changes callback
semantics). (prateekbhujel)
+ . Fix OSS-Fuzz #588264417. (ndossche)
- Curl:
. Fixed curl_reset() retaining CURLOPT_PRIVATE after reset. (lacatoire)
diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c
index 6990466a5957..187603830a8e 100644
--- a/ext/opcache/jit/zend_jit_ir.c
+++ b/ext/opcache/jit/zend_jit_ir.c
@@ -6774,7 +6774,9 @@ static int zend_jit_assign_to_variable(zend_jit_ctx *jit,
if (res_inputs->count == 1) {
phi = res_inputs->refs[0];
} else {
- phi = ir_PHI_N((var_def_info & MAY_BE_LONG & MAY_BE_LONG) ? IR_LONG : IR_DOUBLE,
+ /* var_def_info may be ANY (e.g. ASSIGN_DIM) so use the fact that phi inputs must be the same
type,
+ * and therefore use the type of the incoming values. */
+ phi = ir_PHI_N(jit->ctx.ir_base[res_inputs->refs[0]].type,
res_inputs->count, res_inputs->refs);
}
if (Z_MODE(var_addr) == IS_REG) {
diff --git a/ext/opcache/tests/jit/assign_dim_028.phpt b/ext/opcache/tests/jit/assign_dim_028.phpt
new file mode 100644
index 000000000000..85c4431a14e8
--- /dev/null
+++ b/ext/opcache/tests/jit/assign_dim_028.phpt
@@ -0,0 +1,27 @@
+--TEST--
+JIT ASSIGN_DIM: result in double register with multiple assignment paths
+--EXTENSIONS--
+opcache
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.jit=function
+--FILE--
+<?php
+
+function f($k) {
+ $x = [];
+ for ($i = 0; $i < 3; $i++) {
+ $a + $x[] = $k;
+ $a = $b = $a = $x[$k . $k] = 0.5;
+ }
+ var_dump($a, $b);
+}
+
+f("1");
+
+?>
+--EXPECTF--
+Warning: Undefined variable $a in %s on line %d
+float(0.5)
+float(0.5)