Skip to content

Commit 797e091

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fix trace type inference
2 parents cd4e886 + ee8f9d7 commit 797e091

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
@@ -1665,6 +1665,11 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
16651665
if (opline->result_type != IS_UNUSED) {
16661666
break;
16671667
}
1668+
if (op3_type != IS_UNKNOWN
1669+
&& !zend_jit_supported_binary_op(
1670+
opline->extended_value, MAY_BE_ANY, (1<<op3_type))) {
1671+
break;
1672+
}
16681673
ZEND_FALLTHROUGH;
16691674
case ZEND_ASSIGN_DIM:
16701675
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)