File tree 2 files changed +23
-5
lines changed 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,18 @@ static bool is_live_loop_var_free(
190
190
return false;
191
191
}
192
192
193
- int ssa_var = ssa_op -> op1_use ;
194
- if (ssa_var < 0 ) {
193
+ int var = ssa_op -> op1_use ;
194
+ if (var < 0 ) {
195
195
return false;
196
196
}
197
197
198
- int op_num = scdf -> ssa -> vars [ssa_var ].definition ;
199
- ZEND_ASSERT (op_num >= 0 );
200
- uint32_t def_block = scdf -> ssa -> cfg .map [op_num ];
198
+ zend_ssa_var * ssa_var = & scdf -> ssa -> vars [var ];
199
+ uint32_t def_block ;
200
+ if (ssa_var -> definition >= 0 ) {
201
+ def_block = scdf -> ssa -> cfg .map [ssa_var -> definition ];
202
+ } else {
203
+ def_block = ssa_var -> definition_phi -> block ;
204
+ }
201
205
return zend_bitset_in (scdf -> executable_blocks , def_block );
202
206
}
203
207
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Unreachable code elimination when match argument is a phi node
3
+ --FILE--
4
+ <?php
5
+ $ x = true ;
6
+ match ($ x and true or true ) {
7
+ false => $ x
8
+ };
9
+ ?>
10
+ --EXPECTF--
11
+ Fatal error: Uncaught UnhandledMatchError: Unhandled match case true in %s:%d
12
+ Stack trace:
13
+ #0 {main}
14
+ thrown in %s on line %d
You can’t perform that action at this time.
0 commit comments