Skip to content

Commit

Permalink
Fix access dangling pointer after buffer reallocation
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Mar 26, 2024
1 parent f8c348a commit 64798a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ir_gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ static bool ir_split_partially_dead_node(ir_ctx *ctx, ir_ref ref, uint32_t b)
clones[0].ref = ref;
for (i = 1; i < clones_count; i++) {
clones[i].ref = clone = ir_emit(ctx, insn->optx, insn->op1, insn->op2, insn->op3);
insn = &ctx->ir_base[ref];
if (insn->op1 > 0) ir_use_list_add(ctx, insn->op1, clone);
if (insn->op2 > 0) ir_use_list_add(ctx, insn->op2, clone);
if (insn->op3 > 0) ir_use_list_add(ctx, insn->op3, clone);
Expand Down

0 comments on commit 64798a7

Please sign in to comment.