From 1fd61c5467f727304fd84fd4e9d992532548726d Mon Sep 17 00:00:00 2001 From: dzaima Date: Tue, 29 Jun 2021 22:55:34 +0300 Subject: [PATCH] make err NOINLINE --- src/core/harr.c | 2 +- src/core/stuff.c | 8 ++++++++ src/h.h | 7 +------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/harr.c b/src/core/harr.c index fa2b7708..daeecacb 100644 --- a/src/core/harr.c +++ b/src/core/harr.c @@ -131,7 +131,7 @@ void harrP_visit(Value* x) { assert(x->type==t_harrPartial); usz am = *((HArr*)x)->sh; for (usz i = 0; i < am; i++) mm_visit(p[i]); } -B harrP_get(B x, usz n) { return err("getting item from t_harrPartial"); } +B harrP_get(B x, usz n) { err("getting item from t_harrPartial"); } void harrP_print(B x) { B* p = c(HArr,x)->a; usz am = *c(HArr,x)->sh; diff --git a/src/core/stuff.c b/src/core/stuff.c index dc035df9..48e036e1 100644 --- a/src/core/stuff.c +++ b/src/core/stuff.c @@ -3,6 +3,14 @@ #include "../utils/utf.h" #include "../utils/talloc.h" + +NORETURN NOINLINE void err(char* s) { + puts(s); fflush(stdout); + print_vmStack(); + __builtin_trap(); + exit(1); +} + B bi_emptyHVec, bi_emptyIVec, bi_emptyCVec, bi_emptySVec; NOINLINE TStack* ts_e(TStack* o, u32 elsz, u64 am) { u64 size = o->size; diff --git a/src/h.h b/src/h.h index 8ec2675f..42292453 100644 --- a/src/h.h +++ b/src/h.h @@ -282,12 +282,7 @@ void print_vmStack(); B validate(B x); Value* validateP(Value* x); #endif -static NORETURN B err(char* s) { - puts(s); fflush(stdout); - print_vmStack(); - __builtin_trap(); - exit(1); -} +NORETURN NOINLINE void err(char* s); // tag checks #ifdef ATOM_I32