Branch: Tag:

2013-05-17

2013-05-17 13:43:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Fixed updating of PROGRAM_{NEEDS,USES}_PARENT.

low_inherit() may get called with a parent offset of 24
(OBJECT_PARENT + 42) or 25 (INHERIT_PARENT + 42) when
called from decode_value().

Make sure we don't start zapping flags in random programs
on the compiler stack when this happens.

Fixes [LysLysKOM 20258894] and [LysLysKOM 20273476]/[Pike 13584].

4783:   {    lower_inherit(p, parent, parent_identifier, parent_offset, flags, name);    -  if (parent_offset) { +  /* Don't do this for OBJECT_PARENT or INHERIT_PARENT inherits. +  * They may show up here from decode_value(). +  */ +  if (parent_offset >= 42) {    if (p->flags & (PROGRAM_NEEDS_PARENT|PROGRAM_USES_PARENT)) {    /* We'll need the parent pointer as well... */    struct program_state *state = Pike_compiler;