From: Richard Henderson Date: Tue, 3 Nov 2020 03:36:20 +0000 (-0800) Subject: tcg: Remove assert from set_jmp_reset_offset X-Git-Tag: v5.2.0-rc1~14^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f14bed3fd4a17e1255e2ed6db1dfe50e654e601d;p=thirdparty%2Fqemu.git tcg: Remove assert from set_jmp_reset_offset Since 6e6c4efed99, there has been a more appropriate range check done later at the end of tcg_gen_code. There, a failing range check results in a returned error code, which causes the TB to be restarted at half the size. Reported-by: Sai Pavan Boddu Tested-by: Sai Pavan Boddu Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- diff --git a/tcg/tcg.c b/tcg/tcg.c index f49f1a7f35b..43c6cf8f525 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -335,10 +335,11 @@ static bool tcg_resolve_relocs(TCGContext *s) static void set_jmp_reset_offset(TCGContext *s, int which) { - size_t off = tcg_current_code_size(s); - s->tb_jmp_reset_offset[which] = off; - /* Make sure that we didn't overflow the stored offset. */ - assert(s->tb_jmp_reset_offset[which] == off); + /* + * We will check for overflow at the end of the opcode loop in + * tcg_gen_code, where we bound tcg_current_code_size to UINT16_MAX. + */ + s->tb_jmp_reset_offset[which] = tcg_current_code_size(s); } #include "tcg-target.c.inc"