aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.c
diff options
context:
space:
mode:
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 9822c65..855e4cc 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -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);