File tree 2 files changed +43
-2
lines changed
2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -7204,9 +7204,9 @@ static int zend_jit_cmp(zend_jit_ctx *jit,
7204
7204
7205
7205
while (n) {
7206
7206
n--;
7207
- ir_IF_TRUE( end_inputs->refs[n]);
7207
+ jit_IF_TRUE_FALSE_ex(jit, end_inputs->refs[n], label );
7208
7208
ir_END_list(true_inputs);
7209
- ir_IF_FALSE( end_inputs->refs[n]);
7209
+ jit_IF_TRUE_FALSE_ex(jit, end_inputs->refs[n], label2 );
7210
7210
ir_END_list(false_inputs);
7211
7211
}
7212
7212
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