Skip to content

Commit 3517212

Browse files
committed
Merge branch 'PHP-8.6'
* PHP-8.6: Fix GH-25037: Function JIT ENTRY live var assertion IR: Backport fix for SIGFPE when folding MUL_OV of -1 by INT64_MIN IR: Backport fix for incorrect operand copy in AND/OR/MIN/MAX folding
2 parents fda5cc2 + 17bb27b commit 3517212

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
JIT: IR folding of (a op b) op a for BW_AND and BW_OR
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=64M
8+
opcache.jit=function
9+
--EXTENSIONS--
10+
opcache
11+
--FILE--
12+
<?php
13+
function or1(int $b) { return $b | ($b | 7); }
14+
function or2(int $b) { return ($b | 7) | $b; }
15+
function and1(int $b) { return $b & ($b & 7); }
16+
function and2(int $b) { return ($b & 7) & $b; }
17+
18+
var_dump(or1(2), or2(2), and1(10), and2(10));
19+
?>
20+
--EXPECT--
21+
int(7)
22+
int(7)
23+
int(2)
24+
int(2)

‎ext/opcache/tests/jit/gh25037.phpt‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
GH-25037 (Function JIT: "ENTRY - live var" for a namespaced function call with a recursive self:: call argument)
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=32M
8+
opcache.jit=1205
9+
--EXTENSIONS--
10+
opcache
11+
mbstring
12+
--FILE--
13+
<?php
14+
namespace Reproduce;
15+
16+
class Entry
17+
{
18+
public static function chr(int $ord, string $encoding = 'UTF-8'): string
19+
{
20+
if ($encoding === 'UCS-4BE') {
21+
return pack('N', $ord);
22+
}
23+
24+
return mb_convert_encoding(self::chr($ord, 'UCS-4BE'), $encoding, 'UCS-4BE');
25+
}
26+
}
27+
28+
var_dump(bin2hex(Entry::chr(0x1F35E)));
29+
?>
30+
--EXPECT--
31+
string(8) "f09f8d9e"

0 commit comments

Comments
 (0)