diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-01-28 13:05:14 -1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-03-01 07:33:27 -1000 |
commit | 0ef3d7045b565861496a6cb8460acc5d3bc80744 (patch) | |
tree | 94f5d1c18de516482e09a5f4622738a20d809ccf /tcg | |
parent | 640be074fa1cadf4b1447c122efaaa2987fa774a (diff) | |
download | qemu-0ef3d7045b565861496a6cb8460acc5d3bc80744.zip qemu-0ef3d7045b565861496a6cb8460acc5d3bc80744.tar.gz qemu-0ef3d7045b565861496a6cb8460acc5d3bc80744.tar.bz2 |
tcg: Adjust TCGContext.temps_in_use check
Change the temps_in_use check to use assert not fprintf.
Move the assert for double-free before the check for count,
since that is the more immediate problem.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r-- | tcg/tcg.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -1374,16 +1374,14 @@ void tcg_temp_free_internal(TCGTemp *ts) g_assert_not_reached(); } + tcg_debug_assert(ts->temp_allocated != 0); + ts->temp_allocated = 0; + #if defined(CONFIG_DEBUG_TCG) + assert(s->temps_in_use > 0); s->temps_in_use--; - if (s->temps_in_use < 0) { - fprintf(stderr, "More temporaries freed than allocated!\n"); - } #endif - tcg_debug_assert(ts->temp_allocated != 0); - ts->temp_allocated = 0; - idx = temp_idx(ts); k = ts->base_type + (ts->kind == TEMP_NORMAL ? 0 : TCG_TYPE_COUNT); set_bit(idx, s->free_temps[k].l); |