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.60 1998/01/24 18:36:44 per Exp $"); + RCSID("$Id: interpret.c,v 1.61 1998/01/25 08:25:07 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:525: Inside #if defined(DEBUG)
   backlog[backlogp].pc=pc;    }       if(t_flag > 2)    {    char *file, *f;    INT32 linep, nonblock;    if((nonblock=query_nonblocking(2)))    set_nonblocking(2,0);    -  +     file=get_line(pc-1,fp->context.prog,&linep);    while((f=STRCHR(file,'/'))) file=f+1;    fprintf(stderr,"- %s:%4ld:(%lx): %-25s %4ld %4ld\n",    file,(long)linep,    (long)(pc-fp->context.prog->program-1),    get_f_name(instr + F_OFFSET),    (long)(sp-evaluator_stack),    (long)(mark_sp-mark_stack));    if(nonblock)    set_nonblocking(2,1);
pike.git/src/interpret.c:617:    fp->current_object,    GET_ARG() + fp->context.identifier_level);    sp++;    print_return_value();    break;       CASE(F_EXTERNAL);    {    struct inherit *inherit;    struct program *p; -  INT32 id=GET_ARG(); -  struct object *o=fp->context.parent; -  INT32 i=fp->context.parent_identifier; +  struct object *o; +  INT32 i,id=GET_ARG();    -  +  inherit=&fp->context; +  +  o=fp->current_object; +  +  if(!o) +  error("Current object is destructed\n"); +     while(1)    { -  +  if(inherit->parent_offset) +  { +  i=o->parent_identifier; +  o=o->parent; +  accumulator+=inherit->parent_offset-1; +  }else{ +  i=inherit->parent_identifier; +  o=inherit->parent; +  } +     if(!o) -  error("Parent no longer exists\n"); +  error("Parent was lost during cloning.\n");       if(!(p=o->prog))    error("Attempting to access variable in destructed object\n");       inherit=INHERIT_FROM_INT(p, i);       if(!accumulator) break;    --accumulator; -  -  if(p->identifier_references[id].inherit_offset==0) -  { -  i=o->parent_identifier; -  o=o->parent; -  }else{ -  i=inherit->parent_identifier; -  o=inherit->parent; +     } -  } +        low_object_index_no_free(sp,    o,    id + inherit->identifier_level);    sp++;    print_return_value();    break;    }       CASE(F_EXTERNAL_LVALUE);    {    struct inherit *inherit;    struct program *p; -  INT32 id=GET_ARG(); -  struct object *o=fp->context.parent; -  INT32 i=fp->context.parent_identifier; +  struct object *o; +  INT32 i,id=GET_ARG();    -  +  inherit=&fp->context; +  o=fp->current_object; +  +  if(!o) +  error("Current object is destructed\n"); +     while(1)    { -  +  if(inherit->parent_offset) +  { +  i=o->parent_identifier; +  o=o->parent; +  accumulator+=inherit->parent_offset-1; +  }else{ +  i=inherit->parent_identifier; +  o=inherit->parent; +  } +     if(!o)    error("Parent no longer exists\n");       if(!(p=o->prog))    error("Attempting to access variable in destructed object\n");       inherit=INHERIT_FROM_INT(p, i);       if(!accumulator) break;    accumulator--; -  -  if(p->identifier_references[id].inherit_offset==0) -  { -  i=o->parent_identifier; -  o=o->parent; -  }else{ -  i=inherit->parent_identifier; -  o=inherit->parent; +     } -  } +        ref_push_object(o);    sp->type=T_LVALUE;    sp->u.integer=id + inherit->identifier_level;    sp++;    break;    }          CASE(F_MARK_AND_LOCAL); *(mark_sp++)=sp;
pike.git/src/interpret.c:1556: Inside #if defined(DEBUG)
   ref = p->identifier_references + fun;   #ifdef DEBUG    if(ref->inherit_offset>=p->num_inherits)    fatal("Inherit offset out of range in program.\n");   #endif       /* init a new evaluation frame */    new_frame.parent_frame = fp;    new_frame.current_object = o;    new_frame.context = p->inherits[ ref->inherit_offset ]; -  if(!ref->inherit_offset) new_frame.context.parent=o->parent; +        function = new_frame.context.prog->identifiers + ref->identifier_offset;       new_frame.locals = sp - args;    new_frame.args = args;    new_frame.fun = fun;    new_frame.current_storage = o->storage+new_frame.context.storage_offset;    new_frame.pc = 0;       new_frame.current_object->refs++;