pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*   || 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.342 2003/12/09 15:39:45 grubba Exp $ + || $Id: interpret.c,v 1.343 2004/02/09 22:02:56 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.342 2003/12/09 15:39:45 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.343 2004/02/09 22:02:56 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:535:      static struct inherit dummy_inherit   #ifdef PIKE_DEBUG    = {-4711, -4711, -4711, -4711, (size_t) -4711, -4711, NULL, NULL, NULL}   #endif   ;      PMOD_EXPORT void find_external_context(struct external_variable_context *loc,    int depth)   { -  struct program *p = loc->o->prog; +  struct program *p;       TRACE((4, "-find_external_context(%d, inherit=%ld)\n", depth,    DO_NOT_WARN((long)(loc->o->prog ? loc->inherit - loc->o->prog->inherits : 0))));      #ifdef PIKE_DEBUG    if(!loc->o)    Pike_fatal("No object\n");   #endif    -  +  p = loc->o->prog; +  + #ifdef DEBUG_MALLOC +  if (loc->o->refs == 0x55555555) { +  fprintf(stderr, "The object %p has been zapped!\n", loc->o); +  describe(p); +  Pike_fatal("Object zapping detected.\n"); +  } +  if (p && p->refs == 0x55555555) { +  fprintf(stderr, "The program %p has been zapped!\n", p); +  describe(p); +  fprintf(stderr, "Which taken from the object %p\n", loc->o); +  describe(loc->o); +  Pike_fatal("Looks like the program %p has been zapped!\n", p); +  } + #endif /* DEBUG_MALLOC */ +     while(--depth>=0)    {    struct inherit *inh = loc->inherit;       if (!p)    Pike_error("Attempting to access parent of destructed object.\n");      #ifdef PIKE_DEBUG    if(Pike_interpreter.trace_level>8)    my_describe_inherit_structure(p);
pike.git/src/interpret.c:632: Inside #if defined(DEBUG_MALLOC)
   }    if (p && p->refs == 0x55555555) {    fprintf(stderr, "The program %p has been zapped!\n", p);    describe(p);    fprintf(stderr, "Which taken from the object %p\n", loc->o);    describe(loc->o);    Pike_fatal("Looks like the program %p has been zapped!\n", p);    }   #endif /* DEBUG_MALLOC */    +  if (p) {   #ifdef PIKE_DEBUG    if(loc->parent_identifier < 0 || -  (p && loc->parent_identifier > p->num_identifier_references)) +  loc->parent_identifier > p->num_identifier_references)    Pike_fatal("Identifier out of range, loc->parent_identifer=%d!\n",    loc->parent_identifier);   #endif -  -  if (p) +     loc->inherit=INHERIT_FROM_INT(p, loc->parent_identifier); -  +  }    else    /* Return a valid pointer to a dummy inherit for the convenience    * of the caller. Identifier offsets will be bogus but it'll    * never get to that since the object is destructed. */    loc->inherit = &dummy_inherit;       TRACE((5,"- Parent identifier = %d (%s), inherit # = %ld\n",    loc->parent_identifier,    p ? ID_FROM_INT(p, loc->parent_identifier)->name->str : "N/A",    p ? DO_NOT_WARN((long)(loc->inherit - p->inherits)) : -1));