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 @@ -3343,7 +3343,9 @@ static zend_lifetime_interval** zend_jit_trace_allocate_registers(zend_jit_trace
33433343 intervals [use ]-> used_as_hint = NULL ;
33443344 intervals [use ]-> list_next = NULL ;
33453345 }
3346- } else if (intervals [use ] && !ssa -> vars [phi -> ssa_var ].no_val ) {
3346+ } else if (intervals [use ]
3347+ && (!ssa -> vars [def ].no_val
3348+ || ssa -> var_info [def ].type != ssa -> var_info [use ].type )) {
33473349 if (ssa -> vars [use ].use_chain >= 0 ) {
33483350 intervals [use ]-> flags |= ZREG_STORE ;
33493351 } 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