Branch: Tag:

2004-08-19

2004-08-19 15:00:37 by Henrik Grubbström (Grubba) <grubba@grubba.org>

find_external_context() now supports objects being destructed.
Fixes [bug 3775 (#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/01 19:12:05 mast Exp $ + || $Id: interpret.c,v 1.352 2004/08/19 15:00:37 grubba Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.351 2004/06/01 19:12:05 mast Exp $"); + RCSID("$Id: interpret.c,v 1.352 2004/08/19 15:00:37 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"
563:    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) {
598:       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)