diff --git a/src/interpret.c b/src/interpret.c index 578d02731399a5181b75739aeb63561aae62da5b..da83adb17e81d6c9c5d234d72656fc11a71d99f8 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.20 1997/01/17 21:06:40 hubbe Exp $"); +RCSID("$Id: interpret.c,v 1.21 1997/01/27 01:15:37 hubbe Exp $"); #include "interpret.h" #include "object.h" #include "program.h" @@ -676,7 +676,7 @@ static void eval_instruction(unsigned char *pc) * and then the low array/multiset/mapping manipulation routines can be * destructive if they like */ - if( (1 << sp[-1].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING )) + if( (1 << sp[-1].type) & ( BIT_ARRAY | BIT_MULTISET | BIT_MAPPING | BIT_STRING )) { struct svalue s; s.type=T_INT; @@ -1493,6 +1493,21 @@ void strict_apply_svalue(struct svalue *s, INT32 args) } break; + case T_OBJECT: + { + if(!s->u.object->prog) + error("Calling a destructed object.\n"); + + if(s->u.object->prog->lfuns[LFUN_CALL] == -1) + error("Calling object without `() operator\n"); + + apply_lfun(s->u.object, LFUN_CALL, args); + free_svalue(sp-2); + sp[-2]=sp[-1]; + sp--; + break; + } + default: error("Call to non-function value.\n"); }