More exception stuff
This commit is contained in:
+8
-7
@@ -56,9 +56,8 @@ void lisp_teardown_stack(void) {
|
||||
}
|
||||
|
||||
static ALWAYS_INLINE StackFrame *PUSH_NEW_FRAME(enum StackFrameKind kind) {
|
||||
if (the_stack.depth == the_stack.max_depth) {
|
||||
// TODO error
|
||||
abort();
|
||||
if (the_stack.depth == LISP_STACK_SOFT_MAX_DEPTH) {
|
||||
lisp_signal(Qexcessive_lisp_nesting_error, Qnil);
|
||||
}
|
||||
StackFrame *last_refs =
|
||||
the_stack.depth ? the_stack.frames[the_stack.depth - 1].last_references
|
||||
@@ -250,8 +249,7 @@ void push_dynamic_binding(LispVal *name, LispVal *new_value) {
|
||||
void set_lexical_variable(LispVal *name, LispVal *value) {
|
||||
assert(SYMBOLP(name));
|
||||
if (CONST_VALUE_P(name)) {
|
||||
// TODO throw
|
||||
abort();
|
||||
signal_value_constant(name);
|
||||
}
|
||||
if (DYNAMIC_SYMBOL_P(name)) {
|
||||
SET_SYMBOL_VALUE(name, value);
|
||||
@@ -263,8 +261,7 @@ void set_lexical_variable(LispVal *name, LispVal *value) {
|
||||
void new_lexical_variable(LispVal *name, LispVal *value) {
|
||||
assert(SYMBOLP(name));
|
||||
if (CONST_VALUE_P(name)) {
|
||||
// TODO throw
|
||||
abort();
|
||||
signal_value_constant(name);
|
||||
}
|
||||
if (DYNAMIC_SYMBOL_P(name)) {
|
||||
push_dynamic_binding(name, value);
|
||||
@@ -366,6 +363,7 @@ noreturn void continue_unwinding(void) {
|
||||
}
|
||||
|
||||
noreturn void lisp_signal(LispVal *name, LispVal *data) {
|
||||
CHECK_LISTP(data);
|
||||
if (NILP(Fcondition_class_p(name))) {
|
||||
signal_type_error(name, LIST(Qcondition_class));
|
||||
}
|
||||
@@ -392,3 +390,6 @@ DEFUN(backtrace, "backtrace", (void), "()", "") {
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
DEFINE_SYMBOL(excessive_lisp_nesting_error, "excessive-lisp-nesting-error");
|
||||
DEFINE_CONDITION_CLASS(excessive_lisp_nesting_error, error);
|
||||
|
||||
Reference in New Issue
Block a user