summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-04-06 03:20:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-04-06 03:20:30 -0700
commit8bde000ce358d849a2b5a1c2a88b3be296bfdb6d (patch)
tree2cdc2e27f8fb395a0cff562ba4bfa350ff1b2c15
parent6d1435e494342a99aef04661de7d13f32f02a932 (diff)
downloadtxr-8bde000ce358d849a2b5a1c2a88b3be296bfdb6d.tar.gz
txr-8bde000ce358d849a2b5a1c2a88b3be296bfdb6d.tar.bz2
txr-8bde000ce358d849a2b5a1c2a88b3be296bfdb6d.zip
unwind: fix backtrace-blocking issue.
* unwind.c (uw_rthrow): Only issue the with a "invalid re-entry of exception handling logic" and abort, if the exception being processed is an error. Warnings can occur during the execution of error diagnosis.
-rw-r--r--unwind.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/unwind.c b/unwind.c
index 844c38aa..1fc586fa 100644
--- a/unwind.c
+++ b/unwind.c
@@ -680,14 +680,15 @@ static void invoke_handler(uw_frame_t *fr, struct args *args)
val uw_rthrow(val sym, val args)
{
uw_frame_t *ex;
+ val errorp = uw_exception_subtype_p(sym, error_s);
- if (++reentry_count > 1) {
+ if (++reentry_count > 1 && errorp) {
fprintf(stderr, "txr: invalid re-entry of exception handling logic\n");
abort();
}
#if CONFIG_EXTRA_DEBUGGING
- if (uw_break_on_error && uw_exception_subtype_p(sym, error_s))
+ if (uw_break_on_error && errorp)
breakpt();
#endif
@@ -737,7 +738,7 @@ val uw_rthrow(val sym, val args)
}
if (!opt_compat || opt_compat >= 234) {
- if (!uw_exception_subtype_p(sym, error_s)) {
+ if (!errorp) {
--reentry_count;
return nil;
}