X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterr.c;h=18b3e9e11a70ca5cb611db8c9dbbde151f8dc420;hb=dc5e3163fe667e2629c7769aa8cf2e501eeeefa6;hp=26d2611a679626f23d3f1496653e294ed3dfbb95;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/runtime/interr.c b/src/runtime/interr.c index 26d2611..18b3e9e 100644 --- a/src/runtime/interr.c +++ b/src/runtime/interr.c @@ -13,12 +13,9 @@ * files for more information. */ -/* - * $Header$ - */ - #include #include +#include #include "arch.h" #include "signal.h" @@ -43,7 +40,7 @@ set_lossage_handler(void handler(void)) lossage_handler = handler; } -void +never_returns lose(char *fmt, ...) { va_list ap; @@ -57,6 +54,8 @@ lose(char *fmt, ...) fprintf(stderr, "\n"); fflush(stderr); lossage_handler(); + fprintf(stderr, "Argh! lossage_handler() returned, total confusion..\n"); + exit(1); } /* internal error handler for when the Lisp error system doesn't exist @@ -154,6 +153,16 @@ describe_internal_error(os_context_t *context) lispobj debug_print(lispobj string) { - fprintf(stderr, "%s\n", (char *)(((struct vector *)PTR(string))->data)); + /* This is a kludge. It's not actually safe - in general - to use + %primitive print on the alpha, because it skips half of the + number stack setup that should usually be done on a function call, + so the called routine (i.e. this one) ends up being able to overwrite + local variables in the caller. Rather than fix this everywhere + that %primitive print is used (it's only a debugging aid anyway) + we just put guarantee our safety by putting an unused buffer on + the stack before doing anything else here */ + char untouched[32]; /* GCC warns about not using this, but that's the point.. */ + fprintf(stderr, "%s\n", + (char *)(((struct vector *)native_pointer(string))->data),untouched); return NIL; }