Branch: Tag:

1998-01-29

1998-01-29 00:30:37 by Fredrik H├╝binette (Hubbe) <hubbe@hubbe.net>

identifiers in parents should now work better

Rev: lib/modules/Stdio.pmod:1.13
Rev: src/compilation.h:1.6
Rev: src/docode.c:1.26
Rev: src/fsort.c:1.4
Rev: src/global.h:1.14
Rev: src/las.c:1.47
Rev: src/object.c:1.35
Rev: src/object.h:1.15
Rev: src/pike_memory.c:1.7
Rev: src/program.c:1.59
Rev: src/program.h:1.29

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: program.c,v 1.58 1998/01/28 00:31:17 hubbe Exp $"); + RCSID("$Id: program.c,v 1.59 1998/01/29 00:30:36 hubbe Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
91:   static int current_program_id=0;      struct program *new_program=0; + struct object *fake_object=0;   struct program *malloc_size_program=0;      int compiler_pass;
214: Inside #if 0
  #if 0    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))    { -  ret=mksvaluenode(PROG_FROM_INT(p->new_program, i)->constants+ -  id->func.offset); +  struct svalue *s=PROG_FROM_INT(p->new_program, i)->constants+ +  id->func.offset; +  if(s->type != T_PROGRAM) +  { +  ret=mksvaluenode(s);    return ret;    } -  +  }   #endif -  +     return mkexternalnode(n, i, id);    }    }
367:    struct pike_string *name,    int flags)   { -  int e; +  int e,id=0;       threads_disabled++;    compilation_depth++;
391:    struct svalue s;    s.type=T_PROGRAM;    s.u.program=p; -  add_constant(name, &s, flags); +  id=add_constant(name, &s, flags);    }      #define PUSH
408:    }       malloc_size_program = ALLOC_STRUCT(program); + #ifdef DEBUG +  fake_object=(struct object *)xalloc(sizeof(struct object) + 256*sizeof(struct svalue)); +  /* Stipple to find illegal accesses */ +  MEMSET(fake_object,0x55,sizeof(struct object) + 256*sizeof(struct svalue)); + #else +  fake_object=ALLOC_STRUCT(object); + #endif +  +  fake_object->next=fake_object; +  fake_object->prev=fake_object; +  fake_object->refs=1; +  fake_object->parent=0; +  fake_object->parent_identifier=0; +  fake_object->prog=p; +  p->refs++; +  +  if(name) +  { +  if((fake_object->parent=previous_program_state->fake_object)) +  fake_object->parent->refs++; +  fake_object->parent_identifier=id; +  } +     new_program=p;       if(new_program->program)
559:    malloc_size_program=0;    }    +  if(fake_object) +  { +  fake_object->prog=0; +  free_object(fake_object); +  fake_object=0; +  } +     while(compiler_frame)    pop_compiler_frame();