summaryrefslogtreecommitdiff
path: root/src/lisp/ao_lisp_eval.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-11-05 15:12:05 -0700
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:50 -0800
commit286d07d83bd7ff361e5a904c151a75e5a9c8b071 (patch)
tree1232516bf90042b01779373c1e740063a7839099 /src/lisp/ao_lisp_eval.c
parent3366efb139653939f053c1fe4aba352ba3b66c94 (diff)
altos/lisp: make sure stack->formals_last gets moved during GC
Failing this leads to broken formals chains Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/lisp/ao_lisp_eval.c')
-rw-r--r--src/lisp/ao_lisp_eval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lisp/ao_lisp_eval.c b/src/lisp/ao_lisp_eval.c
index b7e7b972..0de3f190 100644
--- a/src/lisp/ao_lisp_eval.c
+++ b/src/lisp/ao_lisp_eval.c
@@ -14,7 +14,7 @@
#include "ao_lisp.h"
-#if 1
+#if 0
static int stack_depth;
#define DBG_INDENT() do { int _s; for(_s = 0; _s < stack_depth; _s++) printf(" "); } while(0)
#define DBG_IN() (++stack_depth)
@@ -80,6 +80,7 @@ stack_mark(void *addr)
for (;;) {
ao_lisp_poly_mark(stack->actuals);
ao_lisp_poly_mark(stack->formals);
+ /* no need to mark formals_tail */
ao_lisp_poly_mark(stack->frame);
stack = ao_lisp_poly_stack(stack->prev);
if (ao_lisp_mark_memory(stack, sizeof (struct ao_lisp_stack)))
@@ -99,6 +100,7 @@ stack_move(void *addr)
int ret;
(void) ao_lisp_poly_move(&stack->actuals);
(void) ao_lisp_poly_move(&stack->formals);
+ (void) ao_lisp_poly_move(&stack->formals_tail);
(void) ao_lisp_poly_move(&stack->frame);
prev = ao_lisp_poly_stack(stack->prev);
ret = ao_lisp_move(&ao_lisp_stack_type, &prev);
@@ -250,7 +252,7 @@ ao_lisp_lambda(struct ao_lisp_cons *cons)
if (args_wanted != args_provided)
return ao_lisp_error(AO_LISP_INVALID, "need %d args, not %d", args_wanted, args_provided);
next_frame = ao_lisp_frame_new(args_wanted);
- DBGI("new frame %d\n", OFFSET(next_frame));
+// DBGI("new frame %d\n", OFFSET(next_frame));
switch (type) {
case _ao_lisp_atom_lambda: {
int f;