altos/lisp: re-use small frames
[fw/altos] / src / lisp / ao_lisp_atom.c
index 6705f14036c07748a9b3a9004936c67b8bac3cdc..8c9e8ed11346ae5062c3f601ba38b6406f91233d 100644 (file)
@@ -108,7 +108,7 @@ ao_lisp_atom_init(void)
                ao_lisp_frame_global = ao_lisp_frame_new(0);
 }
 
-static ao_poly *
+ao_poly *
 ao_lisp_atom_ref(struct ao_lisp_frame *frame, ao_poly atom)
 {
        ao_poly *ref;
@@ -117,7 +117,7 @@ ao_lisp_atom_ref(struct ao_lisp_frame *frame, ao_poly atom)
                ref = ao_lisp_frame_ref(frame, atom);
                if (ref)
                        return ref;
-               frame = ao_lisp_poly_frame(frame->next);
+               frame = ao_lisp_poly_frame(frame->prev);
        }
        if (ao_lisp_frame_global) {
                ref = ao_lisp_frame_ref(ao_lisp_frame_global, atom);