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.280 2002/11/14 21:28:52 marcus Exp $ + || $Id: interpret.c,v 1.281 2002/11/23 15:11:04 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.280 2002/11/14 21:28:52 marcus Exp $"); + RCSID("$Id: interpret.c,v 1.281 2002/11/23 15:11:04 mast 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:1611:    throw_value.type=T_INT;    }   }      PMOD_EXPORT int apply_low_safe_and_stupid(struct object *o, INT32 offset)   {    JMP_BUF tmp;    struct pike_frame *new_frame=alloc_pike_frame();    int ret;    +  /* FIXME: Is this up-to-date with mega_apply? */    new_frame->next = Pike_fp;    new_frame->current_object = o;    new_frame->context=o->prog->inherits[0];    new_frame->locals = Pike_interpreter.evaluator_stack;    new_frame->expendible=new_frame->locals;    new_frame->args = 0;    new_frame->num_args=0;    new_frame->num_locals=0;    new_frame->fun = o->prog->num_identifier_references?o->prog->num_identifier_references-1:0;    new_frame->pc = 0;
pike.git/src/interpret.c:1655:       POP_PIKE_FRAME();       return ret;   }      PMOD_EXPORT void safe_apply_low2(struct object *o,int fun,int args, int handle_errors)   {    JMP_BUF recovery;    -  Pike_sp-=args; +     free_svalue(& throw_value);    throw_value.type=T_INT; -  if(SETJMP(recovery)) +  if(SETJMP_SP(recovery, args))    {    if(handle_errors) call_handle_error(); -  Pike_sp->u.integer = 0; -  Pike_sp->subtype=NUMBER_NUMBER; -  Pike_sp->type = T_INT; -  Pike_sp++; +  push_int(0);    }else{ -  /* ptrdiff_t expected_stack = Pike_sp - Pike_interpreter.evaluator_stack + 1; */ -  Pike_sp+=args; +     apply_low(o,fun,args); -  /* apply_low already does this, afaics. /mast -  if(Pike_sp - Pike_interpreter.evaluator_stack > expected_stack) -  pop_n_elems(Pike_sp - Pike_interpreter.evaluator_stack - expected_stack); -  if(Pike_sp - Pike_interpreter.evaluator_stack < expected_stack) -  { -  Pike_sp->u.integer = 0; -  Pike_sp->subtype=NUMBER_NUMBER; -  Pike_sp->type = T_INT; -  Pike_sp++; +     } -  */ -  } +     UNSETJMP(recovery);   }      PMOD_EXPORT void safe_apply_low(struct object *o,int fun,int args)   {    safe_apply_low2(o, fun, args, 1);   }      PMOD_EXPORT void safe_apply(struct object *o, const char *fun ,INT32 args)   {
pike.git/src/interpret.c:1774:    STACK_LEVEL_START(args);      #if 0    fprintf(stderr, "safe_apply_handler(\"%s\", 0x%08p, 0x%08p, %d)\n",    fun, handler, compat, args);   #endif /* 0 */       free_svalue(& throw_value);    throw_value.type=T_INT;    -  if (SETJMP(recovery)) { +  if (SETJMP_SP(recovery, args)) {    ret = 0;    } 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");