In normal use, the s7 evaluator pops off irrelevant entries as it
calls functions and whatnot, but here everything is happening in C,
so, as you suggested, I think s7_call_with_catch does need to pop
the stack if it hasn't already been popped; something like:

s7.c ca line 50611

      else
        {
          /* we've replaced our jump point, fix it in this catch too */
          catch_cstack(p) = &new_goto_start;
          push_stack(sc, OP_CATCH, error_handler, p);
          result = s7_call(sc, body, sc->nil);
          if (((opcode_t)sc->stack_end[-1]) == OP_CATCH)
            unstack_with(sc, OP_CATCH);
        }
      restore_jump_info(sc);
    }
  else
    {
      push_stack(sc, OP_CATCH, error_handler, p);
      result = s7_call(sc, body, sc->nil);
      if (((opcode_t)sc->stack_end[-1]) == OP_CATCH)
            unstack_with(sc, OP_CATCH);
    }

I haven't tested this very much...

_______________________________________________
Cmdist mailing list
[email protected]
https://cm-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to