Skip to content

Commit 2f65da0

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fix GH-10635: ARM64 function JIT causes impossible assertion (#10638)
2 parents 2e78c08 + 240c120 commit 2f65da0

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

+3-1
Original file line numberDiff line numberDiff line change
@@ -7623,7 +7623,6 @@ static int zend_jit_identical(dasm_State **Dst,
76237623
}
76247624
op1_addr = real_addr;
76257625
}
7626-
| LOAD_ZVAL_ADDR FCARG1x, op1_addr
76277626
}
76287627
if (opline->op2_type != IS_CONST) {
76297628
if (Z_MODE(op2_addr) == IS_REG) {
@@ -7635,6 +7634,9 @@ static int zend_jit_identical(dasm_State **Dst,
76357634
}
76367635
| LOAD_ZVAL_ADDR FCARG2x, op2_addr
76377636
}
7637+
if (opline->op1_type != IS_CONST) {
7638+
| LOAD_ZVAL_ADDR FCARG1x, op1_addr
7639+
}
76387640
}
76397641

76407642
if ((op1_info & op2_info & MAY_BE_ANY) == 0) {

ext/opcache/jit/zend_jit_x86.dasc

+3-1
Original file line numberDiff line numberDiff line change
@@ -8228,7 +8228,6 @@ static int zend_jit_identical(dasm_State **Dst,
82288228
}
82298229
op1_addr = real_addr;
82308230
}
8231-
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
82328231
}
82338232
if (opline->op2_type != IS_CONST) {
82348233
if (Z_MODE(op2_addr) == IS_REG) {
@@ -8240,6 +8239,9 @@ static int zend_jit_identical(dasm_State **Dst,
82408239
}
82418240
| LOAD_ZVAL_ADDR FCARG2a, op2_addr
82428241
}
8242+
if (opline->op1_type != IS_CONST) {
8243+
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
8244+
}
82438245
}
82448246

82458247
if ((op1_info & op2_info & MAY_BE_ANY) == 0) {
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
JIT IDENTICAL: 003 register allocation
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
opcache.protect_memory=1
9+
--EXTENSIONS--
10+
opcache
11+
--FILE--
12+
<?php
13+
function foo(array $a, int|float $n) {
14+
var_dump(count($a) === $n);
15+
}
16+
foo([1], 1);
17+
?>
18+
--EXPECT--
19+
bool(true)

0 commit comments

Comments
 (0)