Merge branch 'PHP-8.1'

* PHP-8.1:
  JIT: Fix register allocation
This commit is contained in:
Dmitry Stogov 2022-03-14 11:48:11 +03:00
commit 981ae10bf9
2 changed files with 20 additions and 0 deletions

View file

@ -16117,6 +16117,7 @@ bw_op:
if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG)) &&
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG))) {
if (opline->op2_type == IS_CONST &&
opline->op1_type != IS_CONST &&
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG &&
zend_long_is_power_of_two(Z_LVAL_P(RT_CONSTANT(opline, opline->op2))) &&
OP1_HAS_RANGE() &&

View file

@ -0,0 +1,19 @@
--TEST--
Register Alloction 013: Division by zero
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function foo() {
$j++;
$j++ % $j -= $a % $a = $j;
}
foo();
?>
DONE
--EXPECTF--
Warning: Undefined variable $j in %sreg_alloc_013.php on line 3
DONE