Skip to content

Commit 713eec7

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Added test
2 parents a800bc0 + 17b5fe1 commit 713eec7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

ext/opcache/tests/jit/bug81226.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #81226: Integer overflow behavior is different with JIT enabled
3+
--EXTENSIONS--
4+
opcache
5+
--INI--
6+
opcache.enable=1
7+
opcache.enable_cli=1
8+
opcache.jit_buffer_size=1M
9+
opcache.jit=tracing
10+
--SKIPIF--
11+
<?php if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
12+
--FILE--
13+
<?php
14+
// 65-bit hexadecimal number
15+
$hex = '10000000000000041';
16+
17+
for ($i = 0; $i < 200; ++$i) {
18+
$characterReferenceCode = 0;
19+
20+
for ($j = 0, $len = strlen($hex); $j < $len; ++$j) {
21+
$characterReferenceCode *= 16;
22+
$characterReferenceCode += ord($hex[$j]) - 0x0030;
23+
}
24+
25+
assert($characterReferenceCode > 0x10FFFF);
26+
}
27+
?>
28+
OK
29+
--EXPECT--
30+
OK

0 commit comments

Comments
 (0)