Added 'depth' counter to stack frames. The idea is two-fold:
1. You can limit runaway recursion by binding a symbol *max_stack_depth* in the environment 2. You can limit the number of backtrace frames printed. However, neither of these have been implemented yet.
This commit is contained in:
parent
72a8bc09e0
commit
2536e76617
7 changed files with 140 additions and 79 deletions
|
|
@ -68,6 +68,12 @@ extern struct cons_pointer privileged_keyword_location;
|
|||
*/
|
||||
extern struct cons_pointer privileged_keyword_payload;
|
||||
|
||||
/**
|
||||
* Keywords used when constructing exceptions: `:cause`. Instantiated in
|
||||
* `init.c`.
|
||||
*/
|
||||
extern struct cons_pointer privileged_keyword_cause;
|
||||
|
||||
/**
|
||||
* An unallocated cell on the free list - should never be encountered by a Lisp
|
||||
* function.
|
||||
|
|
@ -456,6 +462,8 @@ struct stack_frame {
|
|||
struct cons_pointer function;
|
||||
/** the number of arguments provided. */
|
||||
int args;
|
||||
/** the depth of the stack below this frame */
|
||||
int depth;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue