[CM] (*s7* 'stack)

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Tue Jun 7 11:07:14 PDT 2022


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...



More information about the Cmdist mailing list