summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-14 22:48:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-14 22:48:28 -0700
commit608924d13f5b858549970037873f52e7d0c51774 (patch)
treec32974acfa7874a0bced5fe35c53b8d1ffa55a4d
parent83825423962b9f1cde5c32de6ab1b09aaeef182d (diff)
downloadtxr-608924d13f5b858549970037873f52e7d0c51774.tar.gz
txr-608924d13f5b858549970037873f52e7d0c51774.tar.bz2
txr-608924d13f5b858549970037873f52e7d0c51774.zip
unwind: unbind dyn env when diagnosing unhandled exception.
* unwind.c (uw_unwind_to_exit_point): The error reporting relies on the *stderr* stream, but that stream may be bound in some funny way in a context where an exception has happened, without anything around it to restore that during unwinding. Before diagnosing, we should reset the dynamic environment to the top level, so that the global values of all dynamic variables are revealed.
-rw-r--r--unwind.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index c0516979..3cb47a9a 100644
--- a/unwind.c
+++ b/unwind.c
@@ -120,6 +120,8 @@ static void uw_unwind_to_exit_point(void)
val sym = unhandled_ex.ca.sym;
val args = unhandled_ex.ca.args;
+ dyn_env = nil;
+
if (opt_loglevel >= 1) {
val prefix = scat2(prog_string, lit(":"));