From: Peep P. <so...@us...> - 2004-06-12 20:51:49
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8452 Modified Files: interpret.c lang.y Log Message: Fixed call_other. Index: lang.y =================================================================== RCS file: /cvsroot/agd/server/src/lang.y,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- lang.y 12 Jun 2004 20:08:46 -0000 1.20 +++ lang.y 12 Jun 2004 20:51:40 -0000 1.21 @@ -1090,6 +1090,10 @@ index = add_string_to_table($3); add_token(F_CALL_OTHER); add_two_tokens(index, $5.len); + /* We can't remove the object from the stack + since it's before the arguments - that's + why this pop is necessary. */ + add_token(F_POP); } ; Index: interpret.c =================================================================== RCS file: /cvsroot/agd/server/src/interpret.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- interpret.c 12 Jun 2004 20:06:55 -0000 1.22 +++ interpret.c 12 Jun 2004 20:51:40 -0000 1.23 @@ -575,9 +575,7 @@ case F_CALL_OTHER: cp++; tmps = this_ob->prog->str_tbl[*cp]; - printf("cp: %d; tmps: %s\n", *cp, tmps); cp++; - printf("numarg: %d\n", *cp); sp -= *cp + 1; if(sp->type == T_OBJECT) { tmpv.u.ob = sp->u.ob; /* A little hack so we don't @@ -595,10 +593,12 @@ } tmpi = get_fun_index(tmpv.u.ob, tmps); - free_var(sp); if(tmpi == -1) runtime("function doesn't exist", 0); SETUP_FRAME(); + fp = sp + 1; + sp = fp + 1; + show_stack(); call_function(tmpv.u.ob, tmpi); goto again; break; |