Skip to content

Commit 32d6785

Browse files
committed
Update IR
IR commit: 4cb5282c895908cfd4547ab460de86d189d15177 Fixes GH-15662: Segmentation fault in ext/opcache/jit/ir/ir_cfg.c
1 parent ee715d2 commit 32d6785

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/opcache/jit/ir/ir_cfg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)