mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fix incorrect type store elimination
This commit is contained in:
commit
a23f3dd010
2 changed files with 27 additions and 2 deletions
|
@ -4867,14 +4867,16 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
op2_addr = OP2_REG_ADDR();
|
op2_addr = OP2_REG_ADDR();
|
||||||
|
op2_info = OP2_INFO();
|
||||||
if (ra
|
if (ra
|
||||||
&& ssa_op->op2_def >= 0
|
&& ssa_op->op2_def >= 0
|
||||||
&& !ssa->vars[ssa_op->op2_def].no_val) {
|
&& (!ssa->vars[ssa_op->op2_def].no_val
|
||||||
|
|| (zend_jit_trace_type_to_info(STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var))) & MAY_BE_ANY) !=
|
||||||
|
(op2_info & MAY_BE_ANY))) {
|
||||||
op2_def_addr = OP2_DEF_REG_ADDR();
|
op2_def_addr = OP2_DEF_REG_ADDR();
|
||||||
} else {
|
} else {
|
||||||
op2_def_addr = op2_addr;
|
op2_def_addr = op2_addr;
|
||||||
}
|
}
|
||||||
op2_info = OP2_INFO();
|
|
||||||
CHECK_OP2_TRACE_TYPE();
|
CHECK_OP2_TRACE_TYPE();
|
||||||
op1_info = OP1_INFO();
|
op1_info = OP1_INFO();
|
||||||
if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) == MAY_BE_LONG
|
if ((op1_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) == MAY_BE_LONG
|
||||||
|
|
23
ext/opcache/tests/jit/assign_050.phpt
Normal file
23
ext/opcache/tests/jit/assign_050.phpt
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
--TEST--
|
||||||
|
JIT ASSIGN: incorrect type store elimination
|
||||||
|
--INI--
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
opcache.file_update_protection=0
|
||||||
|
opcache.jit_buffer_size=1M
|
||||||
|
opcache.protect_memory=1
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
function foo($a) {
|
||||||
|
$b = $a;
|
||||||
|
$b =! $a = $a + $b & $b & $b = $b = $a = $a + $b & $a += $a;
|
||||||
|
$b = $b = $a = $a + $b & $b & $b = $a = $a + $b = $b = $a = $a + $b = $a += $a;
|
||||||
|
}
|
||||||
|
|
||||||
|
for ($i = 0; $i < 3; $i++) {
|
||||||
|
@foo(39087589046889428661);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
DONE
|
||||||
|
--EXPECT--
|
||||||
|
DONE
|
Loading…
Add table
Add a link
Reference in a new issue