diff --git a/src/interpret.c b/src/interpret.c index 69ef55916c7b2acc7cecb40c33c7c543a165946b..5d2ced31280bac1cda91d77db61d58d283c47abc 100644 --- a/src/interpret.c +++ b/src/interpret.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: interpret.c,v 1.86 1998/06/01 20:49:33 grubba Exp $"); +RCSID("$Id: interpret.c,v 1.87 1998/06/06 03:25:36 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -1373,7 +1373,7 @@ static int eval_instruction(unsigned char *pc) CASE(F_APPLY_AND_RETURN); { INT32 args=sp - *--mark_sp; - if(fp->locals >= sp-args) + if(fp->expendible >= sp-args) { MEMMOVE(sp-args+1,sp-args,args*sizeof(struct svalue)); sp++; @@ -1387,7 +1387,7 @@ static int eval_instruction(unsigned char *pc) CASE(F_CALL_LFUN_AND_RETURN); { INT32 args=sp - *--mark_sp; - if(fp->locals >= sp-args) + if(fp->expendible >= sp-args) { MEMMOVE(sp-args+1,sp-args,args*sizeof(struct svalue)); sp++; @@ -1924,6 +1924,7 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) #endif new_frame.locals = sp - args; + new_frame.expendible = new_frame.locals; new_frame.args = args; new_frame.fun = fun; new_frame.current_storage = o->storage+new_frame.context.storage_offset; @@ -2093,17 +2094,20 @@ void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) static int o_catch(unsigned char *pc) { JMP_BUF tmp; + struct svalue *expendible=fp->expendible; if(SETJMP(tmp)) { *sp=throw_value; throw_value.type=T_INT; sp++; UNSETJMP(tmp); + fp->expendible=expendible; return 0; }else{ int x=eval_instruction(pc); if(x!=-1) mega_apply(APPLY_STACK, x, 0,0); UNSETJMP(tmp); + fp->expendible=expendible; return 1; } } @@ -2123,6 +2127,7 @@ int apply_low_safe_and_stupid(struct object *o, INT32 offset) new_frame.current_object = o; new_frame.context=o->prog->inherits[0]; new_frame.locals = evaluator_stack; + new_frame.expendible=new_frame.locals; new_frame.args = 0; new_frame.num_args=0; new_frame.num_locals=0; diff --git a/src/interpret.h b/src/interpret.h index 84b43cdd0d7e6123012bbce506e18d25c592a521..de31fc0fe0936d0220bb30bd68017135023f21c7 100644 --- a/src/interpret.h +++ b/src/interpret.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: interpret.h,v 1.20 1998/03/28 15:13:43 grubba Exp $ + * $Id: interpret.h,v 1.21 1998/06/06 03:25:37 hubbe Exp $ */ #ifndef INTERPRET_H #define INTERPRET_H @@ -21,6 +21,7 @@ struct frame unsigned char *pc; struct frame *parent_frame; struct svalue *locals; + struct svalue *expendible; INT32 args; struct object *current_object; struct inherit context;