Skip to content

Commit e11a47f

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix reproducibility of test GH-17190 Fix GH-18294: assertion failure zend_jit_ir.c
2 parents c927d24 + 14853ea commit e11a47f

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13699,6 +13699,13 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit,
1369913699
ref_path = ir_END();
1370013700
ir_IF_TRUE_cold(if_typed);
1370113701

13702+
if (Z_MODE(op3_addr) == IS_REG) {
13703+
zend_jit_addr real_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, (opline+1)->op1.var);
13704+
if (!zend_jit_spill_store_inv(jit, op3_addr, real_addr, op1_data_info)) {
13705+
return 0;
13706+
}
13707+
op3_addr = real_addr;
13708+
}
1370213709
arg2 = jit_ZVAL_ADDR(jit, op3_addr);
1370313710
ir_CALL_3(IR_VOID, ir_CONST_FC_FUNC(zend_jit_assign_op_to_typed_ref),
1370413711
reference, arg2, ir_CONST_FC_FUNC(binary_op));

ext/opcache/tests/jit/gh17190.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ opcache.enable=1
77
opcache.enable_cli=1
88
opcache.file_update_protection=0
99
opcache.jit_buffer_size=32M
10-
opcache.jit=function
10+
opcache.jit=1254
11+
opcache.jit_hot_func=1
12+
opcache.jit_hot_side_exit=1
1113
--FILE--
1214
<?php
1315
$a = [2147483647,2147483647,2147483647,3,0,0,32,2147483584,127];

ext/opcache/tests/jit/gh18294.phpt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--TEST--
2+
GH-18294 (assertion failure zend_jit_ir.c)
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.jit=1152
7+
opcache.jit_hot_func=1
8+
opcache.jit_hot_side_exit=1
9+
--FILE--
10+
<?php
11+
$a = [2147483647,2147483647,2147483647,3,0,0,32,2147483584,127];
12+
print_r(@bitwise_small_split($a));
13+
function bitwise_small_split($val) {
14+
$split = 8;
15+
$len = count($val);
16+
while ($i != $len) {
17+
if (!$overflow) {
18+
$overflow = $split <= $remaining ? 0 : $split - $remaining;
19+
} elseif (++$i != $len) {
20+
$fusion[$i] >>= $overflow;
21+
}
22+
}
23+
return $fusion;
24+
}
25+
?>
26+
--EXPECT--
27+
Array
28+
(
29+
[1] => 0
30+
[2] => 0
31+
[3] => 0
32+
[4] => 0
33+
[5] => 0
34+
[6] => 0
35+
[7] => 0
36+
[8] => 0
37+
)

0 commit comments

Comments
 (0)