File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -4010,7 +4010,7 @@ static bool can_convert_to_double(
4010
4010
for (phi = var -> phi_use_chain ; phi ; phi = zend_ssa_next_use_phi (ssa , var_num , phi )) {
4011
4011
/* Check that narrowing can actually be useful */
4012
4012
type = ssa -> var_info [phi -> ssa_var ].type ;
4013
- if (( type & MAY_BE_ANY ) & ~ (MAY_BE_LONG |MAY_BE_DOUBLE )) {
4013
+ if (type & (( MAY_BE_ANY | MAY_BE_UNDEF ) - (MAY_BE_LONG |MAY_BE_DOUBLE ) )) {
4014
4014
return 0 ;
4015
4015
}
4016
4016
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ JIT ASSIGN: incorrect narrowing to double
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.file_update_protection=0
7
+ opcache.jit_buffer_size=1M
8
+ opcache.protect_memory=1
9
+ --FILE--
10
+ <?php
11
+ function test (){
12
+ $ x = (object )['x ' =>0 ];
13
+ for ($ i =0 ;$ i <10 ;$ i ++){
14
+ +$ a ;
15
+ $ a =$ x ->x ;
16
+ $ a =7 ;
17
+ }
18
+ }
19
+ test ()
20
+ ?>
21
+ DONE
22
+ --EXPECTF--
23
+ Warning: Undefined variable $a in %sassign_047.php on line 5
24
+ DONE
25
+
You can’t perform that action at this time.
0 commit comments