Skip to content

Commit 30f1f4b

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed incorrect double/long register hinting
2 parents 2d0d76c + bbd8752 commit 30f1f4b

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,9 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
30593059

30603060
while (phi) {
30613061
if (intervals[phi->ssa_var]) {
3062-
if (intervals[phi->sources[1]]) {
3062+
if (intervals[phi->sources[1]]
3063+
&& (ssa->var_info[phi->sources[1]].type & MAY_BE_ANY) ==
3064+
(ssa->var_info[phi->ssa_var].type & MAY_BE_ANY)) {
30633065
intervals[phi->sources[1]]->hint = intervals[phi->ssa_var];
30643066
}
30653067
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Register Alloction 005: Incorrect double/long register hinting
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 test() {
11+
$j = 0;
12+
for ($i = 1; $i < 10; $i++) {
13+
$i = 0.0;
14+
$j++;
15+
if ($j > 10) break;
16+
}
17+
}
18+
test();
19+
?>
20+
DONE
21+
--EXPECT--
22+
DONE

0 commit comments

Comments
 (0)