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.305 2003/06/06 13:04:56 nilsson Exp $ + || $Id: interpret.c,v 1.306 2003/06/07 13:28:39 grubba Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.305 2003/06/06 13:04:56 nilsson Exp $"); + RCSID("$Id: interpret.c,v 1.306 2003/06/07 13:28:39 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:1805:    Pike_interpreter.svalue_stack_margin = SVALUE_STACK_MARGIN;    Pike_interpreter.c_stack_margin = C_STACK_MARGIN;    Pike_interpreter.trace_level = old_t_flag;    }    else {    free_svalue(&throw_value);    throw_value.type=T_INT;    }   }    + /* NOTE: This function may only be called from the compiler! */   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; -  +  int use_dummy_reference = !o->prog->num_identifier_references;    -  +  /* This is needed for opcodes that use INHERIT_FROM_* +  * (eg F_EXTERN) to work. +  */ +  if (use_dummy_reference) { +  struct reference dummy_ref = { +  0, 0, ID_HIDDEN, +  }; +  add_to_identifier_references(dummy_ref); +  } +     /* 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->fun = o->prog->num_identifier_references-1;    new_frame->pc = 0;    new_frame->current_storage=o->storage;    new_frame->context.parent=0;    Pike_fp = new_frame;       add_ref(new_frame->current_object);    add_ref(new_frame->context.prog);       if(SETJMP(tmp))    {
pike.git/src/interpret.c:1847:    Pike_mark_sp=new_frame->save_mark_sp;      #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack)    Pike_fatal("Stack error (simple).\n");   #endif    ret=0;    }    UNSETJMP(tmp);    +  if (use_dummy_reference) { +  Pike_compiler->new_program->num_identifier_references--; +  } +     POP_PIKE_FRAME();       return ret;   }      PMOD_EXPORT void safe_apply_low2(struct object *o,int fun,int args, int handle_errors)   {    JMP_BUF recovery;       free_svalue(& throw_value);