1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed incorrect trace type inference

Fixes oss-fuzz #63623
This commit is contained in:
Dmitry Stogov
2023-10-27 16:12:18 +03:00
parent ad1fbde7c8
commit c19347a0d3
2 changed files with 25 additions and 2 deletions

View File

@@ -791,7 +791,6 @@ static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const
{
int var, use, def, src;
zend_ssa_op *op;
uint32_t n;
if (tssa->vars[ssa_var].definition_phi) {
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
src = pi->ssa_var;
goto copy_info;
}
#if 0
while (bb->idom >= 0) {
uint32_t n;
b = bb->idom;
bb = ssa->cfg.blocks + b;
@@ -854,6 +855,7 @@ static int zend_jit_trace_copy_ssa_var_info(const zend_op_array *op_array, const
goto copy_info;
}
}
#endif
}
} else if (tssa->vars[ssa_var].definition >= 0) {
def = tssa->vars[ssa_var].definition;

View File

@@ -0,0 +1,21 @@
--TEST--
Register Alloction 020: Incorrect TSSA type inference
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function foo() {
for($j=0; $j<6; $j++) {
$y = $a;
$a = 6;
for(;$i;);
}
}
@foo();
?>
DONE
--EXPECTF--
DONE