mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Fix register allocation
This commit is contained in:
commit
981ae10bf9
2 changed files with 20 additions and 0 deletions
|
@ -16117,6 +16117,7 @@ bw_op:
|
||||||
if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG)) &&
|
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))) {
|
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG))) {
|
||||||
if (opline->op2_type == IS_CONST &&
|
if (opline->op2_type == IS_CONST &&
|
||||||
|
opline->op1_type != IS_CONST &&
|
||||||
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG &&
|
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG &&
|
||||||
zend_long_is_power_of_two(Z_LVAL_P(RT_CONSTANT(opline, opline->op2))) &&
|
zend_long_is_power_of_two(Z_LVAL_P(RT_CONSTANT(opline, opline->op2))) &&
|
||||||
OP1_HAS_RANGE() &&
|
OP1_HAS_RANGE() &&
|
||||||
|
|
19
ext/opcache/tests/jit/reg_alloc_013.phpt
Normal file
19
ext/opcache/tests/jit/reg_alloc_013.phpt
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue