pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.278 2002/11/10 20:19:18 grubba Exp $ + || $Id: interpret.c,v 1.279 2002/11/11 13:13:09 grubba Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.278 2002/11/10 20:19:18 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.279 2002/11/11 13:13:09 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:1754:    struct object *master_obj = master();    if ((i = find_identifier(fun, master_obj->prog)) != -1)    safe_apply_low2(master_obj, i, args, 1);    else {    pop_n_elems(args);    push_undefined();    }    }   }    + /* NOTE: Returns 1 if result on stack, 0 otherwise. */   PMOD_EXPORT int safe_apply_handler(const char *fun,    struct object *handler,    struct object *compat,    INT32 args,    TYPE_FIELD rettypes)   {    JMP_BUF recovery;    int ret; -  +  +  STACK_LEVEL_START(args); +    #if 0    fprintf(stderr, "safe_apply_handler(\"%s\", 0x%08p, 0x%08p, %d)\n",    fun, handler, compat, args);   #endif /* 0 */    -  Pike_sp-=args; +     free_svalue(& throw_value);    throw_value.type=T_INT;    -  if (SETJMP(recovery)) +  if (SETJMP(recovery)) {    ret = 0; -  else { -  Pike_sp += args; -  +  } else {    if (low_unsafe_apply_handler (fun, handler, compat, args) &&    rettypes && !((1 << Pike_sp[-1].type) & rettypes)) {    if ((rettypes & BIT_ZERO) && SAFE_IS_ZERO (Pike_sp - 1)) {    pop_stack();    push_int(0);    }    else {    push_constant_text("Invalid return value from %s: %O\n");    push_text(fun);    push_svalue(Pike_sp - 3);
pike.git/src/interpret.c:1798:    Pike_error("%s", Pike_sp[-1].u.string->str);    else    Pike_error("Invalid return value from %s\n", fun);    }    }       ret = 1;    }       UNSETJMP(recovery); +  +  STACK_LEVEL_DONE(ret); +     return ret;   }      PMOD_EXPORT void apply_lfun(struct object *o, int fun, int args)   {   #ifdef PIKE_DEBUG    if(fun < 0 || fun >= NUM_LFUNS)    Pike_fatal("Apply lfun on illegal value!\n");   #endif    if(!o->prog)