Fix lexical jump errors

This commit is contained in:
2026-09-05 01:13:30 -07:00
parent 956297335d
commit 4aeb7c0be5
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
;; -*- mode: lisp-data -*-
(prin1 (let ((l (block 'c (lambda () (return-from 'c 3)))))
(prin1 (let ((l (block 'c (lambda () (return-from 'd 3)))))
(block 'c
(funcall l))))
(write-byte ?\n)
+6 -1
View File
@@ -419,9 +419,12 @@ DEFSPECIAL(return_from, "return-from", (LispVal * name, LispVal *value),
longjmp(*frame->block.target, 1);
}
}
}
// block went out of scope
lisp_signal(Qblock_out_of_scope_error, LIST(name));
} else {
// block never existed
lisp_signal(Qno_such_block_error, LIST(name));
}
}
DEFUN(backtrace, "backtrace", (void), "()", "") {
@@ -442,5 +445,7 @@ DEFUN(backtrace, "backtrace", (void), "()", "") {
DEFINE_SYMBOL(no_such_block_error, "no-such-block-error");
DEFINE_CONDITION_CLASS(no_such_block_error, error);
DEFINE_SYMBOL(block_out_of_scope_error, "block-out-of-scope-error");
DEFINE_CONDITION_CLASS(block_out_of_scope_error, error);
DEFINE_SYMBOL(excessive_lisp_nesting_error, "excessive-lisp-nesting-error");
DEFINE_CONDITION_CLASS(excessive_lisp_nesting_error, error);
+2
View File
@@ -157,6 +157,8 @@ DECLARE_FUNCTION(backtrace, (void) );
DECLARE_SYMBOL(no_such_block_error);
MAKE_CONDITION_CLASS(no_such_block_error);
DECLARE_SYMBOL(block_out_of_scope_error);
MAKE_CONDITION_CLASS(block_out_of_scope_error);
DECLARE_SYMBOL(excessive_lisp_nesting_error);
MAKE_CONDITION_CLASS(excessive_lisp_nesting_error);