From d02d52dfa675f13fdf8d05f66b0448a71f0057db Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Thu, 1 Dec 2011 15:15:45 +0100 Subject: [PATCH] Improve message when ctx is freed, but still referenced Instead of a cryptic 'Assertion "ctx->ref == 0" failed' we report 'isl_ctx freed, but some objects still reference it'. Signed-off-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- isl_ctx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isl_ctx.c b/isl_ctx.c index bea6efb9..b5d5fcf7 100644 --- a/isl_ctx.c +++ b/isl_ctx.c @@ -132,7 +132,11 @@ void isl_ctx_free(struct isl_ctx *ctx) { if (!ctx) return; - isl_assert(ctx, ctx->ref == 0, return); + if (ctx->ref != 0) + isl_die(ctx, isl_error_invalid, + "isl_ctx freed, but some objects still reference it", + return); + isl_hash_table_clear(&ctx->id_table); isl_blk_clear_cache(ctx); isl_int_clear(ctx->zero); -- 2.11.4.GIT