Skip to content

Commit e139bc4

Browse files
philmdrth7680
authored andcommitted
tcg: Allocate TEMP_VAL_MEM frame in temp_load()
Be sure to allocate the temp frame if it wasn't. In the resolved issues, incomplete dead code elimination left a load at the top of an unreachable loop. We simply need to allocate the stack slot to avoid crashing. Fixes: c896fe2 ("TCG code generator") Reported-by: Michael Tokarev <[email protected]> Reported-by: Helge Konetzka <[email protected]> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2891 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2899 Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Signed-off-by: Richard Henderson <[email protected]> Message-ID: <[email protected]>
1 parent 0adf626 commit e139bc4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tcg/tcg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4671,6 +4671,9 @@ static void temp_load(TCGContext *s, TCGTemp *ts, TCGRegSet desired_regs,
46714671
ts->mem_coherent = 0;
46724672
break;
46734673
case TEMP_VAL_MEM:
4674+
if (!ts->mem_allocated) {
4675+
temp_allocate_frame(s, ts);
4676+
}
46744677
reg = tcg_reg_alloc(s, desired_regs, allocated_regs,
46754678
preferred_regs, ts->indirect_base);
46764679
tcg_out_ld(s, ts->type, reg, ts->mem_base->reg, ts->mem_offset);

0 commit comments

Comments
 (0)