more clear messages on empty_free / builtin_free

This commit is contained in:
dzaima 2025-04-21 03:39:58 +03:00
parent f9b3aba234
commit 64339466cc

View File

@ -679,8 +679,8 @@ static void freed_visit(Value* x) {
fatal("visiting t_freed\n"); fatal("visiting t_freed\n");
#endif #endif
} }
static void empty_free(Value* x) { fatal("FREEING EMPTY\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("FREEING BUILTIN\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) { } DEF_FREE(def) { }
static void def_visit(Value* x) { fatal("undefined visit for object\n"); } 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)); } static void def_print(FILE* f, B x) { fprintf(f, "(%d=%s)", v(x)->type, type_repr(v(x)->type)); }