pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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: pike_types.c,v 1.247 2005/05/19 22:35:31 mast Exp $ + || $Id: pike_types.c,v 1.248 2005/06/03 14:54:36 grubba Exp $   */      #include "global.h"   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"
pike.git/src/pike_types.c:334:    struct pike_type *car,    struct pike_type *cdr,    int flag_method)   {    unsigned INT32 hash = DO_NOT_WARN((unsigned INT32)    ((ptrdiff_t)type*0x10204081)^    (0x8003*PTR_TO_INT(car))^    ~(0x10001*PTR_TO_INT(cdr)));    unsigned INT32 index = hash % pike_type_hash_size;    struct pike_type *t; + #ifdef PIKE_EXTRA_DEBUG +  static unsigned INT32 extra_debug_index = (unsigned INT32)~0; + #endif /* PIKE_EXTRA_DEBUG */       /* PIKE_DEBUG code */    if (type & ~255) {    /* The bad type node on OSF/1 seems to be:    *    * type: 0xffff    * car: valid pointer.    * cdr: 0x400000000    * next: 0x100000000    */
pike.git/src/pike_types.c:357:    type, get_name_of_type(type),    car, cdr);    }    if (index >= pike_type_hash_size) {    Pike_fatal("Modulo operation failed for hash:%u, index:%u, "    "size:%"PRINTSIZET"d.\n",    hash, index, pike_type_hash_size);    }    /* End PIKE_DEBUG code */    -  for(t = pike_type_hash[index]; t; t = t->next) { +    #ifdef PIKE_EXTRA_DEBUG -  if ((type == T_FUNCTION) && +  if ((!~extra_debug_index) && +  (type == T_FUNCTION) &&    (car->type == T_STRING) &&    (cdr->type == T_FUNCTION) &&    (cdr->car->type == T_STRING) &&    (cdr->cdr->type == T_MANY) &&    (cdr->cdr->car->type == T_VOID) &&    (cdr->cdr->cdr->type == T_STRING)) {    /* Attempt to detect why we get a core-dump on OSF/1    * when loading Unicode.so from test_resolv.    *    * The problem triggs when the type for normalize() is created.    * function(string,string:string)    * /grubba 2005-02-04 -  +  * +  * Load order: +  * Module Hashtable status Note +  * Nettle.so OK +  * ___Oracle.so - load_module() fails. +  * Image.so - loads ok. +  * Unicode.so FAIL +  * +  * pike_type node: +  * Field Before After +  * t 1404b5020 1404b5020 +  * t->type 4 (function) 65535 (unknown) +  * t->car 1404863f8 (1404863f8) 140557560 (1404863f8) +  * t->cdr 1404b43d8 (1404b43d8) 400000000 (1404b43d8) +  * t->next 0 100000000 +  * /grubba 2005-06-03    */ -  +  extra_debug_index = index; +  } + #endif /* PIKE_EXTRA_DEBUG */ +  for(t = pike_type_hash[index]; t; t = t->next) { + #ifdef PIKE_EXTRA_DEBUG +  if (index == extra_debug_index) {    fprintf(stderr,    " %s:%d:PIKE_EXTRA_DEBUG:\n"    " t: %p\n",    __FILE__, __LINE__,    t);    fprintf(stderr,    " t->type:%d (%s)\n"    " t->car: %p (%p)\n"    " t->cdr: %p (%p)\n"    " t->next:%p\n",