diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-04-06 03:20:30 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-04-06 03:20:30 -0700 |
commit | 8bde000ce358d849a2b5a1c2a88b3be296bfdb6d (patch) | |
tree | 2cdc2e27f8fb395a0cff562ba4bfa350ff1b2c15 | |
parent | 6d1435e494342a99aef04661de7d13f32f02a932 (diff) | |
download | txr-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |