File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ int ir_build_cfg(ir_ctx *ctx)
97
97
/* Some successors of IF and SWITCH nodes may be inaccessible by backward DFS */
98
98
use_list = & ctx -> use_lists [end ];
99
99
n = use_list -> count ;
100
- if (n > 1 ) {
100
+ if (n > 1 || ( n == 1 && ( ir_op_flags [ insn -> op ] & IR_OP_FLAG_TERMINATOR ) != 0 ) ) {
101
101
for (p = & ctx -> use_edges [use_list -> refs ]; n > 0 ; p ++ , n -- ) {
102
102
/* Remember possible inaccessible successors */
103
103
ir_bitset_incl (bb_leaks , * p );
@@ -245,6 +245,7 @@ int ir_build_cfg(ir_ctx *ctx)
245
245
IR_ASSERT (ref );
246
246
ir_ref pred_b = _blocks [ref ];
247
247
ir_block * pred_bb = & blocks [pred_b ];
248
+ IR_ASSERT (pred_b > 0 );
248
249
* q = pred_b ;
249
250
edges [pred_bb -> successors + pred_bb -> successors_count ++ ] = b ;
250
251
}
You can’t perform that action at this time.
0 commit comments