Branch: Tag:

2004-08-19

2004-08-19 14:58:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

find_external_context() now supports objects being destructed.
Fixes [bug 3775].

Rev: src/interpret.c:1.352

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret.c,v 1.351 2004/06/02 00:09:48 nilsson Exp $ + || $Id: interpret.c,v 1.352 2004/08/19 14:58:21 grubba Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.351 2004/06/02 00:09:48 nilsson Exp $"); + RCSID("$Id: interpret.c,v 1.352 2004/08/19 14:58:21 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
561:    Pike_fatal("No object\n");   #endif    -  p = loc->o->prog; +  if (!(p = loc->o->prog)) { +  /* magic fallback */ +  p = get_program_for_object_being_destructed(loc->o); +  if(!p) +  { +  Pike_error("Cannot access parent of destructed object.\n"); +  } +  }      #ifdef DEBUG_MALLOC    if (loc->o->refs == 0x55555555) {
596:       TRACE((4,"- o->parent_identifier=%d inherit->identifier_level=%d\n",    (p->flags & PROGRAM_USES_PARENT) ? -  PARENT_INFO(loc->o)->parent_identifier : -1, +  LOW_PARENT_INFO(loc->o, p)->parent_identifier : -1,    inh->identifier_level));       switch(inh->parent_offset)