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.321 2003/08/07 18:38:10 mast Exp $ + || $Id: interpret.c,v 1.322 2003/08/07 23:11:22 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.321 2003/08/07 18:38:10 mast Exp $"); + RCSID("$Id: interpret.c,v 1.322 2003/08/07 23:11:22 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:1682:    Pike_fatal("Stack error (also simple).\n"); \    ) \    \    Pike_mark_sp=Pike_fp->save_mark_sp; \    \    POP_PIKE_FRAME()         void low_return(void)   { + #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR) +  /* If the function that returns is the only ref to the current +  * object and its program then the program would be freed in +  * destruct_objects_to_destruct below. However, we're still +  * executing in an opcode in its code so we need prog->program to +  * stick around for a little while more to handle the returned +  * address. We therefore add a ref to the current object so that +  * it'll live through this function. */ +  struct object *o = Pike_fp->current_object; +  add_ref (o); + #endif +     basic_low_return();    if(save_sp+1 > Pike_sp)    {    push_int(0);    }else{    if(save_sp+1 < Pike_sp)    {    assign_svalue(save_sp,Pike_sp-1);    pop_n_elems(Pike_sp-save_sp-1);       /* consider using a flag for immediate destruct instead... */    destruct_objects_to_destruct();    }    if(Pike_interpreter.trace_level>1) trace_return_value();    } -  +  + #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR) +  free_object (o); + #endif   }      void low_return_pop(void)   { -  + #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR) +  /* See note above. */ +  struct object *o = Pike_fp->current_object; +  add_ref (o); + #endif +     basic_low_return();       if(save_sp < Pike_sp)    {    pop_n_elems(Pike_sp-save_sp);    /* consider using a flag for immediate destruct instead... */    destruct_objects_to_destruct();    } -  +  + #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR) +  sub_ref (o); + #endif   }         void unlink_previous_frame(void)   {    struct pike_frame *current, *prev;    struct svalue *target, **smsp;    int freespace;       current=Pike_interpreter.frame_pointer;