diff --git a/error.c b/error.c index 054a780a..bc618630 100644 --- a/error.c +++ b/error.c @@ -12,7 +12,7 @@ #include "picrin/error.h" void -pic_abort(pic_state *pic, const char *msg) +pic_panic(pic_state *pic, const char *msg) { UNUSED(pic); @@ -98,7 +98,7 @@ pic_raise(pic_state *pic, pic_value err) pic->err = err; if (! pic->jmp) { puts(pic_errmsg(pic)); - pic_abort(pic, "no handler found on stack"); + pic_panic(pic, "no handler found on stack"); } longjmp(*pic->jmp, 1); diff --git a/gc.c b/gc.c index bb241a43..6712dd9e 100644 --- a/gc.c +++ b/gc.c @@ -138,7 +138,7 @@ pic_alloc(pic_state *pic, size_t size) ptr = alloc(NULL, size); if (ptr == NULL && size > 0) { - pic_abort(pic, "memory exhausted"); + pic_panic(pic, "memory exhausted"); } return ptr; } @@ -148,7 +148,7 @@ pic_realloc(pic_state *pic, void *ptr, size_t size) { ptr = alloc(ptr, size); if (ptr == NULL && size > 0) { - pic_abort(pic, "memory exhausted"); + pic_panic(pic, "memory exhausted"); } return ptr; } @@ -161,7 +161,7 @@ pic_calloc(pic_state *pic, size_t count, size_t size) size *= count; ptr = alloc(NULL, size); if (ptr == NULL && size > 0) { - pic_abort(pic, "memory exhausted"); + pic_panic(pic, "memory exhausted"); } memset(ptr, 0, size); return ptr; @@ -523,7 +523,7 @@ gc_mark_object(pic_state *pic, struct pic_object *obj) case PIC_TT_CHAR: case PIC_TT_EOF: case PIC_TT_UNDEF: - pic_abort(pic, "logic flaw"); + pic_panic(pic, "logic flaw"); } } @@ -717,7 +717,7 @@ gc_finalize_object(pic_state *pic, struct pic_object *obj) case PIC_TT_CHAR: case PIC_TT_EOF: case PIC_TT_UNDEF: - pic_abort(pic, "logic flaw"); + pic_panic(pic, "logic flaw"); } } @@ -846,7 +846,7 @@ pic_obj_alloc_unsafe(pic_state *pic, size_t size, enum pic_tt tt) add_heap_page(pic); obj = (struct pic_object *)gc_alloc(pic, size); if (obj == NULL) - pic_abort(pic, "GC memory exhausted"); + pic_panic(pic, "GC memory exhausted"); } } obj->tt = tt; diff --git a/include/picrin.h b/include/picrin.h index fe564822..3df0c538 100644 --- a/include/picrin.h +++ b/include/picrin.h @@ -203,7 +203,7 @@ void pic_import(pic_state *, pic_value); void pic_import_library(pic_state *, struct pic_lib *); void pic_export(pic_state *, pic_sym); -noreturn void pic_abort(pic_state *, const char *); +noreturn void pic_panic(pic_state *, const char *); noreturn void pic_errorf(pic_state *, const char *, ...); void pic_warnf(pic_state *, const char *, ...); pic_str *pic_get_backtrace(pic_state *); diff --git a/symbol.c b/symbol.c index 6629abac..c15a967d 100644 --- a/symbol.c +++ b/symbol.c @@ -78,7 +78,7 @@ pic_ungensym(pic_state *pic, pic_sym base) name = pic_symbol_name(pic, base); if ((occr = strrchr(name, '@')) == NULL) { - pic_abort(pic, "logic flaw"); + pic_panic(pic, "logic flaw"); } return pic_intern(pic, name, occr - name); }