summaryrefslogtreecommitdiffstats
path: root/unwind.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-20 17:40:24 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-20 17:40:24 -0800
commit00f823aee439ed8c2cdd71dfbb89385dc68eae7b (patch)
treee30066afd19f0ab5d31b87c5e2645d6f25ca4596 /unwind.c
parent1dc0ed67b0b00b74f2abbf4e5a5d9512bb04dab0 (diff)
downloadtxr-00f823aee439ed8c2cdd71dfbb89385dc68eae7b.tar.gz
txr-00f823aee439ed8c2cdd71dfbb89385dc68eae7b.tar.bz2
txr-00f823aee439ed8c2cdd71dfbb89385dc68eae7b.zip
* unwind.c (uw_throw): If streams are not initialized,
we have an unhandled exception too early in initialization. Use C stream to print an error message and abort. Using the nil stream variable will just cause a recursion bomb.
Diffstat (limited to 'unwind.c')
-rw-r--r--unwind.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index 76f9a47f..1365c7c2 100644
--- a/unwind.c
+++ b/unwind.c
@@ -215,6 +215,11 @@ val uw_throw(val sym, val exception)
}
if (ex == 0) {
+ if (std_error == 0) {
+ fprintf(stderr, "unhandled exception in early initialization\n");
+ abort();
+ }
+
if (opt_loglevel >= 1) {
val s = stringp(exception);
format(std_error, lit("~a: unhandled exception of type ~a:\n"),