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.119 1999/04/08 23:54:28 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.120 1999/04/15 04:08:14 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:687:    case T_MAPPING:    error("Attempt to call a mapping\n");    default:    error("Call to non-function value type:%s.\n",    get_name_of_type(s->type));       case T_FUNCTION:    if(s->subtype == FUNCTION_BUILTIN)    {   #ifdef PIKE_DEBUG +  struct svalue *expected_stack = sp-args;    if(t_flag>1)    {    init_buf();    describe_svalue(s,0,0);    do_trace_call(args);    }   #endif    (*(s->u.efun->function))(args); -  +  + #ifdef PIKE_DEBUG +  if(sp != expected_stack + !s->u.efun->may_return_void) +  { +  if(sp < expected_stack) +  fatal("Function popped too many arguments: %s\n", +  s->u.efun->name->str); +  if(sp>expected_stack+1) +  fatal("Function left droppings on stack: %s\n", +  s->u.efun->name->str); +  if(sp == expected_stack && !s->u.efun->may_return_void) +  fatal("Non-void function returned without return value on stack: %s %d\n", +  s->u.efun->name->str,s->u.efun->may_return_void); +  if(sp==expected_stack+1 && s->u.efun->may_return_void) +  fatal("Void function returned with a value on the stack: %s %d\n", +  s->u.efun->name->str, s->u.efun->may_return_void); +  } + #endif +     break;    }else{    o=s->u.object;    fun=s->subtype;    goto apply_low;    }    break;       case T_ARRAY:   #ifdef PIKE_DEBUG