Skip to content

Commit 024755c

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fix trace type inference
2 parents 313371a + 797e091 commit 024755c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16621662
if (opline->result_type != IS_UNUSED) {
16631663
break;
16641664
}
1665+
if (op3_type != IS_UNKNOWN
1666+
&& !zend_jit_supported_binary_op(
1667+
opline->extended_value, MAY_BE_ANY, (1<<op3_type))) {
1668+
break;
1669+
}
16651670
ZEND_FALLTHROUGH;
16661671
case ZEND_ASSIGN_DIM:
16671672
if (opline->op1_type == IS_CV) {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
JIT ASSIGN_DIM: 010
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
function test() {
11+
for($i=0; $i<10; $i++) {
12+
$a[] &= $y;
13+
$a = null;
14+
$a[] =& $y;
15+
}
16+
}
17+
test();
18+
?>
19+
DONE
20+
--EXPECTF--
21+
Warning: Undefined variable $a in %sassign_dim_010.php on line 4
22+
23+
Warning: Undefined variable $y in %sassign_dim_010.php on line 4
24+
DONE

0 commit comments

Comments
 (0)