pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:2036:   struct node_s *find_inherited_identifier(struct program_state *inherit_state,    int inherit_depth, int inh,    struct pike_string *ident)   {    int id;       if (inh < -1) {    /* Unspecified inherit, but not inherit #0. */    struct node_s *res = NULL;    struct program *p = inherit_state->new_program; -  assert(!inherit_depth); +     for (inh = 1; inh < p->num_inherits; inh++) { -  +  struct node_s *n;    if (p->inherits[inh].inherit_level != 1) continue;    /* NB: We can't recurse here, as that would resolve the magic    * identifiers multiple times on multiple inherit.    */    id = low_reference_inherited_identifier(inherit_state, inh, ident,    SEE_PROTECTED);    if (id == -1) continue; -  +  if (inherit_depth) { +  n = mkexternalnode(inherit_state->new_program, id); +  } else { +  n = mkidentifiernode(id); +  }    if (res) { -  res = mknode(F_ARG_LIST, res, mkidentifiernode(id)); +  res = mknode(F_ARG_LIST, res, n);    } else { -  res = mkidentifiernode(id); +  res = n;    }    }    if (res) {    if (res->token == F_ARG_LIST) res = mkefuncallnode("aggregate", res);    return res;    }    inh = -1;    } else {    if (inh > 0) {    /* Specified inherit. */
pike.git/src/program.c:2182:    /* Found! */    name = id->name;    break;    }    if (!name) {    yyerror("Failed to find current class in its parent.");    return NULL;    }       /* Find ::name in the parent. */ -  i = reference_inherited_identifier(state->previous, NULL, name); -  if (i == -1) { +  n = find_inherited_identifier(state->previous, state_depth+1, -2, +  name); +  if (!n) {    my_yyerror("Failed to find previous inherited definition of %S "    "in parent.", name);    return NULL;    } -  n = mkexternalnode(parent, i); +     } else {    n = mkefuncallnode("object_program",    mkthisnode(state->new_program, inherit_num));    }    /* We know this expression is constant. */    n->node_info &= ~OPT_NOT_CONST;    n->tree_info &= ~OPT_NOT_CONST;    return n;    }