File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -3075,7 +3075,9 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
3075
3075
intervals [use ]-> used_as_hint = NULL ;
3076
3076
intervals [use ]-> list_next = NULL ;
3077
3077
}
3078
- } else if (intervals [use ] && !ssa -> vars [phi -> ssa_var ].no_val ) {
3078
+ } else if (intervals [use ]
3079
+ && (!ssa -> vars [def ].no_val
3080
+ || ssa -> var_info [def ].type != ssa -> var_info [use ].type )) {
3079
3081
if (ssa -> vars [use ].use_chain >= 0 ) {
3080
3082
intervals [use ]-> flags |= ZREG_STORE ;
3081
3083
} else {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Register Alloction 006: Incorrect type store elimination
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.file_update_protection=0
7
+ opcache.jit_buffer_size=1M
8
+ --FILE--
9
+ <?php
10
+ function foo () {
11
+ $ a = 0 ;
12
+ for ($ i =0 ; $ i < 6 ; $ i ++) {
13
+ $ y - $ b = $ a ? $ b : $ y ;
14
+ $ a = $ b = 7 ;
15
+ }
16
+ }
17
+ foo ()
18
+ ?>
19
+ DONE
20
+ --EXPECTF--
21
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
22
+
23
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
24
+
25
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
26
+
27
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
28
+
29
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
30
+
31
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
32
+
33
+ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
34
+ DONE
You can’t perform that action at this time.
0 commit comments