pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:3250:    if((pass != COMPILER_PASS_FIRST) && name)    {    struct identifier *i;    id=isidentifier(name);    if (id < 0)    Pike_fatal("Program constant disappeared in second pass.\n");    i=ID_FROM_INT(Pike_compiler->new_program, id);    free_type(i->type);    i->type=get_type_of_svalue(&tmp);    } -  - #if 0 -  /* Reset annotations so that they can be readded properly. */ -  for (e = 0; e < p->num_annotations; e++) { -  do_free_array(p->annotations[e]); -  p->annotations[e] = NULL; +     } -  for (e = 0; e < p->num_inherits; e++) { -  struct inherit *inh = p->inherits + e; -  if (inh->inherit_level > 1) continue; -  if (!inh->annotations) continue; -  free_array(inh->annotations); -  inh->annotations = NULL; -  } - #endif /* 0 */ -  } +     if (pass == COMPILER_PASS_FIRST) {    if(c->compilation_depth >= 1) {    add_ref(p->parent = Pike_compiler->new_program);    debug_malloc_touch (p);    }    }    p->flags &=~ PROGRAM_VIRGIN;    if(idp) *idp=id;       CDFPRINTF("th(%ld) %p low_start_new_program() %s "
pike.git/src/program.c:5275:    Pike_compiler->new_program->    inherits[Pike_compiler->num_inherits+1].prog;    inherit_offset = Pike_compiler->num_inherits + 1;    Pike_compiler->num_inherits += old_p->num_inherits;       if (old_p != p) {    yyerror("Got different program for inherit in second pass "    "(resolver problem).");    }    - #if 0 -  /* Restore annotations (if any) to and from the inherited program. */ -  if (p->inherits->annotations) { -  struct inherit *src_inh = p->inherits; -  struct inherit *dst_inh = -  Pike_compiler->new_program->inherits + inherit_offset; -  struct array *annotations; -  int found_inh = 0; -  int e; -  -  dst_inh->annotations = annotations = copy_array(src_inh->annotations); -  for (e = 0; e < annotations->size; e++) { -  if (TYPEOF(ITEM(annotations)[e]) == PIKE_T_OBJECT) { -  /* FIXME: Subtyped objects? */ -  struct object *ann = ITEM(annotations)[e].u.object; -  if (ann->prog && ann->prog->inherits[0].annotations) { -  /* Check if it has the @Inherited annotation. */ -  struct array *a = ann->prog->inherits[0].annotations; -  int is_inherited = 0; -  int ee; -  for (ee = 0; ee < a->size; ee++) { -  if ((TYPEOF(ITEM(a)[ee]) == PIKE_T_OBJECT) && -  (ITEM(a)[ee].u.object == Inherited_annotation)) { -  is_inherited = 1; -  break; -  } -  } -  if (is_inherited) { -  found_inh++; -  add_program_annotation(0, &(ITEM(annotations)[e])); -  -  /* Switch out the annotation with a placeholding marker, -  * so that we can perform the filtering (if any) -  * more efficiently below. -  * -  * We use the Inherited_annotation object -  * as the placeholding marker. -  */ -  SET_SVAL(ITEM(annotations)[e], PIKE_T_OBJECT, 0, -  object, Inherited_annotation); -  add_ref(Inherited_annotation); -  free_object(ann); -  } -  } -  } -  } -  if (found_inh) { -  if (found_inh == annotations->size) { -  free_array(annotations); -  dst_inh->annotations = NULL; -  } else { -  ref_push_object(Inherited_annotation); -  dst_inh->annotations = -  subtract_array_svalue(annotations, Pike_sp - 1); -  pop_stack(); -  free_array(annotations); -  } -  } -  } while(0); - #endif /* 0 */ -  +     if (Pike_compiler->compiler_pass == COMPILER_PASS_EXTRA) {    return;    }       assert(Pike_compiler->compiler_pass == COMPILER_PASS_LAST);       if (!(p->flags & PROGRAM_FINISHED)) {    /* Require that the inherited program really is finished in pass    * 2. Otherwise we might not have all definitions when we    * fixate our program.