summaryrefslogtreecommitdiffstats
path: root/unwind.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-08 06:42:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-08 06:42:26 -0700
commit58bea998f5e5581ba8568dd83c4bebf883fabf76 (patch)
tree590036140a855386871c62e32b1d8c00679bcc45 /unwind.h
parentcf4fe3baa5208bb84c956efd0d4eb1e4465c55f0 (diff)
downloadtxr-58bea998f5e5581ba8568dd83c4bebf883fabf76.tar.gz
txr-58bea998f5e5581ba8568dd83c4bebf883fabf76.tar.bz2
txr-58bea998f5e5581ba8568dd83c4bebf883fabf76.zip
New frame type to block bad unwinding and cont capture.
If some external function is invoked which can call back into TXR Lisp, we should guard against the called-back code from capturing a continuation across the external stack frames, and also from unwinding across those frames. This patch prepares a mechanism for this. * unwind.c (uw_unwind_to_exit_point): Abort with message on standard error if attempt is made to unwind across UW_GUARD frame. (uw_push_guard): New function. (uw_capture_cont): If the frame search encounters a UW_GUARD block, an exception is thrown. * unwind.h (enum uw_frtype): New enum constant, UW_GUARD. (uw_push_guard): Declared.
Diffstat (limited to 'unwind.h')
-rw-r--r--unwind.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/unwind.h b/unwind.h
index 8ada31d8..ba2ac767 100644
--- a/unwind.h
+++ b/unwind.h
@@ -27,7 +27,7 @@
typedef union uw_frame uw_frame_t;
typedef enum uw_frtype {
UW_BLOCK, UW_CAPTURED_BLOCK, UW_ENV, UW_CATCH, UW_HANDLE,
- UW_CONT_COPY, UW_DBG
+ UW_CONT_COPY, UW_GUARD, UW_DBG
} uw_frtype_t;
struct uw_common {
@@ -123,6 +123,7 @@ noreturn val uw_errorfv(val fmt, struct args *args);
val uw_register_subtype(val sub, val super);
val uw_exception_subtype_p(val sub, val sup);
void uw_continue(uw_frame_t *curr, uw_frame_t *target);
+void uw_push_guard(uw_frame_t *);
void uw_push_debug(uw_frame_t *, val func, struct args *,
val ub_p_a_pairs, val env, val data,
val line, val chr);