Branch: Tag:

2014-12-04

2014-12-04 19:24:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fixed some parent access issues.

The parent could get lost if the symbol was an inherited local constant.

918:    }    } else if (level) {    if (IDENTIFIER_IS_CONSTANT(id->identifier_flags) && -  (ref->id_flags & ID_INLINE) && !ref->inherit_offset && +  (ref->id_flags & ID_INLINE) &&    (id->func.const_info.offset >= 0)) {    /* An inline, local or final constant identifier in    * a lexically surrounding (aka parent) class.
926:    * the constant to this class.    */    struct svalue *s = &state->new_program-> +  inherits[ref->inherit_offset].prog->    constants[id->func.const_info.offset].sval;    if (TYPEOF(*s) == T_PROGRAM &&    s->u.program->flags & PROGRAM_USES_PARENT) {
936:    emit1(F_CONSTANT, tmp1);    }    } else { +  struct program_state *state = Pike_compiler; +  int e; +  for (e = level; e; e--) { +  state->new_program->flags |= +  PROGRAM_USES_PARENT|PROGRAM_NEEDS_PARENT; +  state = state->previous; +  }    emit2(F_EXTERNAL, n->u.integer.b, level);    }    } else if (n->u.integer.b == IDREF_MAGIC_THIS) {