aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-06-19 06:32:03 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-06-19 14:51:51 -0700
commit732d58979c9d6ab1b955b65264a15d0696ea477e (patch)
tree476ed04dbf18cd7a2431d3c2202174c8437f45da /tcg
parentc1c091948ae4a73c1a80b5005f6204d0e665ce52 (diff)
downloadqemu-732d58979c9d6ab1b955b65264a15d0696ea477e.zip
qemu-732d58979c9d6ab1b955b65264a15d0696ea477e.tar.gz
qemu-732d58979c9d6ab1b955b65264a15d0696ea477e.tar.bz2
tcg: Restart when exhausting the stack frame
Assume that we'll have fewer temps allocated after restarting with a fewer number of instructions. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index bdeea18..5e53c33 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -3038,7 +3038,11 @@ static void temp_allocate_frame(TCGContext *s, TCGTemp *ts)
assert(align <= TCG_TARGET_STACK_ALIGN);
off = ROUND_UP(s->current_frame_offset, align);
- assert(off + size <= s->frame_end);
+
+ /* If we've exhausted the stack frame, restart with a smaller TB. */
+ if (off + size > s->frame_end) {
+ tcg_raise_tb_overflow(s);
+ }
s->current_frame_offset = off + size;
ts->mem_offset = off;