From 64339466cc5478c5f6cc72aacbd03047785d5f60 Mon Sep 17 00:00:00 2001 From: dzaima Date: Mon, 21 Apr 2025 03:39:58 +0300 Subject: [PATCH] more clear messages on empty_free / builtin_free --- src/load.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/load.c b/src/load.c index 34cb1881..f28e8240 100644 --- a/src/load.c +++ b/src/load.c @@ -679,8 +679,8 @@ static void freed_visit(Value* x) { fatal("visiting t_freed\n"); #endif } -static void empty_free(Value* x) { fatal("FREEING EMPTY\n"); } -static void builtin_free(Value* x) { fatal("FREEING BUILTIN\n"); } +static void empty_free(Value* x) { fatal("Attempted to free empty object; double-free, wrong refcount management, or heap corruption!\n"); } +static void builtin_free(Value* x) { fatal("Attempted to free a builtin object; double-free, wrong refcount management, or heap corruption!\n"); } DEF_FREE(def) { } static void def_visit(Value* x) { fatal("undefined visit for object\n"); } static void def_print(FILE* f, B x) { fprintf(f, "(%d=%s)", v(x)->type, type_repr(v(x)->type)); }