[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/62] tcg: Adjust TCGContext.temps_in_use check
From: |
Richard Henderson |
Subject: |
[PULL 32/62] tcg: Adjust TCGContext.temps_in_use check |
Date: |
Tue, 28 Feb 2023 16:56:13 -1000 |
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>
---
tcg/tcg.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 9822c65ea8..855e4cc537 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -1374,16 +1374,14 @@ void tcg_temp_free_internal(TCGTemp *ts)
g_assert_not_reached();
}
-#if defined(CONFIG_DEBUG_TCG)
- 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;
+#if defined(CONFIG_DEBUG_TCG)
+ assert(s->temps_in_use > 0);
+ s->temps_in_use--;
+#endif
+
idx = temp_idx(ts);
k = ts->base_type + (ts->kind == TEMP_NORMAL ? 0 : TCG_TYPE_COUNT);
set_bit(idx, s->free_temps[k].l);
--
2.34.1
- [PULL 20/62] target/rx: Replace `tb_pc()` with `tb->pc`, (continued)
- [PULL 20/62] target/rx: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 17/62] target/tricore: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 21/62] target/riscv: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 15/62] accel/tcg: Move jmp-cache `CF_PCREL` checks to caller, Richard Henderson, 2023/02/28
- [PULL 19/62] target/sh4: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 22/62] target/openrisc: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 23/62] target/mips: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 24/62] target/microblaze: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 28/62] target/hexagon: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 30/62] target/arm: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 32/62] tcg: Adjust TCGContext.temps_in_use check,
Richard Henderson <=
- [PULL 25/62] target/loongarch: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 31/62] include/exec: Remove `tb_pc()`, Richard Henderson, 2023/02/28
- [PULL 33/62] accel/tcg: Pass max_insn to gen_intermediate_code by pointer, Richard Henderson, 2023/02/28
- [PULL 29/62] target/avr: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 34/62] accel/tcg: Use more accurate max_insns for tb_overflow, Richard Henderson, 2023/02/28
- [PULL 35/62] tcg: Remove branch-to-next regardless of reference count, Richard Henderson, 2023/02/28
- [PULL 26/62] target/i386: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 27/62] target/hppa: Replace `tb_pc()` with `tb->pc`, Richard Henderson, 2023/02/28
- [PULL 36/62] tcg: Rename TEMP_LOCAL to TEMP_TB, Richard Henderson, 2023/02/28
- [PULL 37/62] tcg: Use noinline for major tcg_gen_code subroutines, Richard Henderson, 2023/02/28