diff --git a/src/interpret.c b/src/interpret.c index eb9e80ff267e49cee59677495dcce5f2bc4c8650..2014d3a316a1fe028d1b247ea139788787959ee8 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.92 1998/07/17 19:53:16 hubbe Exp $"); +RCSID("$Id: interpret.c,v 1.93 1998/07/28 23:02:42 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -1373,8 +1373,10 @@ static int eval_instruction(unsigned char *pc) CASE(F_APPLY_AND_RETURN); { INT32 args=sp - *--mark_sp; +/* fprintf(stderr,"%p >= %p\n",fp->expendible,sp-args); */ if(fp->expendible >= sp-args) { +/* fprintf(stderr,"NOT EXPENDIBLE!\n"); */ MEMMOVE(sp-args+1,sp-args,args*sizeof(struct svalue)); sp++; sp[-args-1].type=T_INT; @@ -2128,10 +2130,12 @@ static int o_catch(unsigned char *pc) fp->expendible=expendible; return 0; }else{ - int x=eval_instruction(pc); + int x; + fp->expendible=fp->locals + fp->num_locals; + x=eval_instruction(pc); + fp->expendible=expendible; if(x!=-1) mega_apply(APPLY_STACK, x, 0,0); UNSETJMP(tmp); - fp->expendible=expendible; return 1; } } diff --git a/src/testsuite.in b/src/testsuite.in index 5dbc7d10007ec10faf5773827f1de6669700f8f6..adfdc1bd2fccb195659ba6d3d207982fbe0a3cac 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -1,4 +1,4 @@ -stest_true([["$Id: testsuite.in,v 1.117 1998/07/15 23:35:14 hubbe Exp $"]]) +stest_true([["$Id: testsuite.in,v 1.118 1998/07/28 23:02:43 hubbe Exp $"]]) cond([[all_constants()->_verify_internals]], [[ test_do(_verify_internals()) @@ -2302,6 +2302,9 @@ test_eq(20,catch(throw(a()))) // - catch compile-errors test_any([[ master()->set_inhibit_compile_errors(lambda(){});mixed res = catch{compile_string("dfasfqw123");};master()->set_inhibit_compile_errors(0); return arrayp(res); ]], 1) +// catch +test_false([[class X { string test(string foo) { catch { return lower_case(foo); }; return foo; }}()->test(0); ]]) + // - time test_true(intp(time())) test_true(intp(time(1)))