From c9212a1f57f92f2431a479dace855d878d35e9d8 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 22 Nov 2022 09:26:25 +0300 Subject: [PATCH] Add missed slot for "fixed" live_intervals for all "scratch" registers --- ir_aarch64.dasc | 2 +- ir_x86.dasc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ir_aarch64.dasc b/ir_aarch64.dasc index 5c7c3e5..667d1c5 100644 --- a/ir_aarch64.dasc +++ b/ir_aarch64.dasc @@ -4411,7 +4411,7 @@ static void ir_allocate_unique_spill_slots(ir_ctx *ctx) ctx->regs = ir_mem_malloc(sizeof(ir_regs) * ctx->insns_count); memset(ctx->regs, IR_REG_NONE, sizeof(ir_regs) * ctx->insns_count); - ctx->live_intervals = ir_mem_calloc(ctx->vregs_count + 1 + IR_REG_NUM, sizeof(ir_live_interval*)); + ctx->live_intervals = ir_mem_calloc(ctx->vregs_count + 1 + IR_REG_NUM + 1, sizeof(ir_live_interval*)); for (b = 1, bb = ctx->cfg_blocks + b; b <= ctx->cfg_blocks_count; b++, bb++) { if (bb->flags & IR_BB_UNREACHABLE) { continue; diff --git a/ir_x86.dasc b/ir_x86.dasc index 69e6e38..1cea2ee 100644 --- a/ir_x86.dasc +++ b/ir_x86.dasc @@ -6883,7 +6883,7 @@ static void ir_allocate_unique_spill_slots(ir_ctx *ctx) ctx->regs = ir_mem_malloc(sizeof(ir_regs) * ctx->insns_count); memset(ctx->regs, IR_REG_NONE, sizeof(ir_regs) * ctx->insns_count); - ctx->live_intervals = ir_mem_calloc(ctx->vregs_count + 1 + IR_REG_NUM, sizeof(ir_live_interval*)); + ctx->live_intervals = ir_mem_calloc(ctx->vregs_count + 1 + IR_REG_NUM + 1, sizeof(ir_live_interval*)); for (b = 1, bb = ctx->cfg_blocks + b; b <= ctx->cfg_blocks_count; b++, bb++) { if (bb->flags & IR_BB_UNREACHABLE) { continue;