Branch: Tag:

1998-01-25

1998-01-25 08:28:45 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

jumbopatch! (DEBUG_MALLOC + parent feature fix)

Rev: src/ChangeLog:1.130
Rev: src/acconfig.h:1.15
Rev: src/array.c:1.22
Rev: src/array.h:1.6
Rev: src/builtin_functions.c:1.62
Rev: src/builtin_functions.h:1.6
Rev: src/cpp.c:1.14
Rev: src/dmalloc.h:1.1
Rev: src/docode.c:1.25
Rev: src/dynamic_buffer.c:1.6
Rev: src/dynamic_buffer.h:1.4
Rev: src/error.c:1.10
Rev: src/error.h:1.9
Rev: src/fdlib.c:1.9
Rev: src/gc.c:1.27
Rev: src/global.h:1.13
Rev: src/interpret.c:1.61
Rev: src/language.yacc:1.54
Rev: src/las.c:1.43
Rev: src/las.h:1.11
Rev: src/lex.c:1.40
Rev: src/lex.h:1.9
Rev: src/main.c:1.35
Rev: src/main.h:1.4
Rev: src/mapping.c:1.27
Rev: src/mapping.h:1.7
Rev: src/module.c:1.7
Rev: src/modules/Image/colortable.c:1.36
Rev: src/modules/Image/encodings/gif.c:1.30
Rev: src/modules/Image/encodings/png.c:1.2
Rev: src/modules/Image/encodings/pnm.c:1.12
Rev: src/modules/Image/encodings/x.c:1.5
Rev: src/modules/Yp/yp.c:1.10
Rev: src/modules/files/efuns.c:1.44
Rev: src/modules/files/file.c:1.69
Rev: src/modules/files/socket.c:1.25
Rev: src/modules/files/socktest.pike:1.7
Rev: src/modules/spider/accesseddb.c:1.13
Rev: src/modules/spider/dumudp.c:1.32
Rev: src/modules/spider/spider.c:1.51
Rev: src/modules/system/system.c:1.39
Rev: src/multiset.c:1.9
Rev: src/object.c:1.33
Rev: src/peep.c:1.17
Rev: src/pike_memory.c:1.4
Rev: src/pike_memory.h:1.2
Rev: src/pike_types.c:1.29
Rev: src/pike_types.h:1.7
Rev: src/program.c:1.54
Rev: src/program.h:1.27
Rev: src/stralloc.c:1.24
Rev: src/stralloc.h:1.12
Rev: src/testsuite.in:1.68
Rev: src/threads.c:1.53

4:   ||| 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"
532: Inside #if defined(DEBUG)
   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",
624:    {    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");
640:       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,
663:    {    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");   
679:       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;
1563:    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;