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)
9797 /* Some successors of IF and SWITCH nodes may be inaccessible by backward DFS */
9898 use_list = & ctx -> use_lists [end ];
9999 n = use_list -> count ;
100- if (n > 1 ) {
100+ if (n > 1 || ( n == 1 && ( ir_op_flags [ insn -> op ] & IR_OP_FLAG_TERMINATOR ) != 0 ) ) {
101101 for (p = & ctx -> use_edges [use_list -> refs ]; n > 0 ; p ++ , n -- ) {
102102 /* Remember possible inaccessible successors */
103103 ir_bitset_incl (bb_leaks , * p );
@@ -245,6 +245,7 @@ int ir_build_cfg(ir_ctx *ctx)
245245 IR_ASSERT (ref );
246246 ir_ref pred_b = _blocks [ref ];
247247 ir_block * pred_bb = & blocks [pred_b ];
248+ IR_ASSERT (pred_b > 0 );
248249 * q = pred_b ;
249250 edges [pred_bb -> successors + pred_bb -> successors_count ++ ] = b ;
250251 }
You can’t perform that action at this time.
0 commit comments