altos/lisp: bounds check in move_map plus binary search
[fw/altos] / src / lisp / ao_lisp_make_const.c
index 0f243eb0731e8c5407ee0a2d74822a09b89c22fc..de9c57251bc954378b00bd2f134e69f445a1f468 100644 (file)
@@ -71,6 +71,7 @@ struct builtin_func funcs[] = {
        { .name = "led",        .args = AO_LISP_FUNC_F_LEXPR,   .func = builtin_led },
        { .name = "save",       .args = AO_LISP_FUNC_F_LAMBDA,  .func = builtin_save },
        { .name = "restore",    .args = AO_LISP_FUNC_F_LAMBDA,  .func = builtin_restore },
+       { .name = "call/cc",    .args = AO_LISP_FUNC_F_LAMBDA,  .func = builtin_call_cc },
 };
 
 #define N_FUNC (sizeof funcs / sizeof funcs[0])
@@ -306,8 +307,8 @@ main(int argc, char **argv)
        ao_poly val;
        struct ao_lisp_atom     *a;
        struct ao_lisp_builtin  *b;
-       int     in_atom;
-       char    *out_name;
+       int     in_atom = 0;
+       char    *out_name = NULL;
        int     c;
 
        in = stdin;
@@ -358,7 +359,7 @@ main(int argc, char **argv)
        /* Reduce to referenced values */
        ao_lisp_collect(AO_LISP_COLLECT_FULL);
 
-       for (f = 0; f < ao_lisp_frame_num(ao_lisp_frame_global); f++) {
+       for (f = 0; f < ao_lisp_frame_global->num; f++) {
                val = ao_has_macro(ao_lisp_frame_global->vals[f].val);
                if (val != AO_LISP_NIL) {
                        printf("error: function %s contains unresolved macro: ",