Skip to content

Commit c19347a

Browse files
committed
Fixed incorrect trace type inference
Fixes oss-fuzz #63623
1 parent ad1fbde commit c19347a

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

ext/opcache/jit/zend_jit_trace.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const
791791
{
792792
int var, use, def, src;
793793
zend_ssa_op *op;
794-
uint32_t n;
795794

796795
if (tssa->vars[ssa_var].definition_phi) {
797796
uint32_t b = ssa->cfg.map[tssa_opcodes[0] - op_array->opcodes];
@@ -817,8 +816,10 @@ static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const
817816
src = pi->ssa_var;
818817
goto copy_info;
819818
}
820-
819+
#if 0
821820
while (bb->idom >= 0) {
821+
uint32_t n;
822+
822823
b = bb->idom;
823824
bb = ssa->cfg.blocks + b;
824825

@@ -854,6 +855,7 @@ static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const
854855
goto copy_info;
855856
}
856857
}
858+
#endif
857859
}
858860
} else if (tssa->vars[ssa_var].definition >= 0) {
859861
def = tssa->vars[ssa_var].definition;
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
Register Alloction 020: Incorrect TSSA type inference
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 foo() {
11+
for($j=0; $j<6; $j++) {
12+
$y = $a;
13+
$a = 6;
14+
for(;$i;);
15+
}
16+
}
17+
@foo();
18+
?>
19+
DONE
20+
--EXPECTF--
21+
DONE

0 commit comments

Comments
 (0)