From 7dd3f8335ce5add324d3bc78bf4d0e45290251d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 6 Apr 2023 03:20:30 -0700 Subject: 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. --- unwind.c | 7 ++++--- 1 file 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; } -- cgit v1.2.3