diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-02-06 23:20:11 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-02-06 23:20:11 -0800 |
commit | 61302673d5870dc3eae32ba0e1c60d2d9f6aef21 (patch) | |
tree | b0237a81a10577cde9682429ab4c59fe71c21451 | |
parent | acec7e13a32778dcd75f26b847c36fe838f7a21a (diff) | |
download | txr-61302673d5870dc3eae32ba0e1c60d2d9f6aef21.tar.gz txr-61302673d5870dc3eae32ba0e1c60d2d9f6aef21.tar.bz2 txr-61302673d5870dc3eae32ba0e1c60d2d9f6aef21.zip |
* unwind.c (uw_throw): Detect invalid re-entry and bail.
Cautiously, we use fprintf rather than our streams system, in case some
problem with the streams is involved in this mess.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | unwind.c | 7 |
2 files changed, 13 insertions, 0 deletions
@@ -1,5 +1,11 @@ 2015-02-06 Kaz Kylheku <kaz@kylheku.com> + * unwind.c (uw_throw): Detect invalid re-entry and bail. + Cautiously, we use fprintf rather than our streams system, in case some + problem with the streams is involved in this mess. + +2015-02-06 Kaz Kylheku <kaz@kylheku.com> + * unwind.c (uw_throw): Put a txr: prefix on the unhandled exception in early initialization message. @@ -260,6 +260,12 @@ val uw_exception_subtype_p(val sub, val sup) val uw_throw(val sym, val args) { uw_frame_t *ex; + static int reentry_count = 0; + + if (++reentry_count > 1) { + fprintf(stderr, "txr: invalid re-entry of exception handling logic\n"); + abort(); + } if (!listp(args)) args = cons(args, nil); @@ -334,6 +340,7 @@ val uw_throw(val sym, val args) ex->ca.sym = sym; ex->ca.args = args; uw_exit_point = ex; + reentry_count--; uw_unwind_to_exit_point(); abort(); } |