File tree Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -7208,9 +7208,9 @@ static int zend_jit_cmp(zend_jit_ctx *jit,
72087208
72097209 while (n) {
72107210 n--;
7211- ir_IF_TRUE( end_inputs->refs[n]);
7211+ jit_IF_TRUE_FALSE_ex(jit, end_inputs->refs[n], label );
72127212 ir_END_list(true_inputs);
7213- ir_IF_FALSE( end_inputs->refs[n]);
7213+ jit_IF_TRUE_FALSE_ex(jit, end_inputs->refs[n], label2 );
72147214 ir_END_list(false_inputs);
72157215 }
72167216 ir_MERGE_list(true_inputs);
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16984 (function JIT overflow bug)
3+ --EXTENSIONS--
4+ opcache
5+ --SKIPIF--
6+ <?php if (PHP_INT_SIZE != 8 ) die ("skip: 64-bit only " ); ?>
7+ --INI--
8+ opcache.enable=1
9+ opcache.enable_cli=1
10+ opcache.file_update_protection=0
11+ opcache.jit_buffer_size=32M
12+ opcache.jit=function
13+ --FILE--
14+ <?php
15+
16+ final class Test {
17+ public int $ integer = -1 ;
18+
19+ public function foo (int $ x ) {
20+ return $ x ;
21+ }
22+ }
23+
24+ function foo (Test $ test , int $ value ) {
25+ $ val = $ test ->foo ($ value );
26+ if ($ val <= PHP_INT_MAX ) {
27+ $ test ->integer = $ val ;
28+ }
29+ }
30+
31+ function main () {
32+ $ test = new Test ;
33+ foo ($ test , 9223372036854775806 );
34+ foo ($ test , 9223372036854775807 ); // Also reproduces without this call, but this imitates the psalm code
35+ var_dump ($ test ->integer );
36+ }
37+
38+ main ();
39+ ?>
40+ --EXPECT--
41+ int(9223372036854775807)
You can’t perform that action at this time.
0 commit comments