pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: interpret.c,v 1.63 1998/01/29 06:02:28 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.64 1998/01/30 20:04:32 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:1431:    CASE(F_APPLY_AND_POP);    strict_apply_svalue(fp->context.prog->constants + GET_ARG(), sp - *--mark_sp );    pop_stack();    break;       CASE(F_CALL_FUNCTION);    mega_apply(APPLY_STACK,sp - *--mark_sp,0,0);    break;       CASE(F_CALL_FUNCTION_AND_RETURN); -  return sp - *--mark_sp; +  { +  INT32 args=sp - *--mark_sp; +  if(!args) +  error("Too few arguments to call_function()\n"); +  switch(sp[-args].type) +  { +  case T_INT: +  case T_STRING: +  case T_FLOAT: +  case T_MAPPING: +  case T_MULTISET: +  error("Attempting to call a non-function value (%s).\n",get_name_of_type(sp[-args].type)); +  } +  return args; +  }       default:    fatal("Strange instruction %ld\n",(long)instr);    }    }   }      void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)   {    struct object *o;