Skip to content

Commit 2bed115

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fix register allocation
2 parents 2862553 + e20f955 commit 2bed115

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16179,6 +16179,7 @@ bw_op:
1617916179
if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG)) &&
1618016180
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG))) {
1618116181
if (opline->op2_type == IS_CONST &&
16182+
opline->op1_type != IS_CONST &&
1618216183
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG &&
1618316184
zend_long_is_power_of_two(Z_LVAL_P(RT_CONSTANT(opline, opline->op2))) &&
1618416185
OP1_HAS_RANGE() &&
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Register Alloction 013: Division by zero
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+
$j++;
12+
$j++ % $j -= $a % $a = $j;
13+
}
14+
foo();
15+
?>
16+
DONE
17+
--EXPECTF--
18+
Warning: Undefined variable $j in %sreg_alloc_013.php on line 3
19+
DONE

0 commit comments

Comments
 (0)