Branch: Tag:

2000-11-26

2000-11-26 14:20:24 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now works when PIKE_DEBUG is defined again.

Rev: src/las.c:1.224

5:   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.223 2000/11/25 16:45:02 grubba Exp $"); + RCSID("$Id: las.c,v 1.224 2000/11/26 14:20:24 grubba Exp $");      #include "language.h"   #include "interpret.h"
427: Inside #if defined(SHARED_NODES)
     static node *freeze_node(node *orig)   { -  size_t hash = hash_node(orig); +  size_t hash;    node *n;    int found = 0;    -  /* free_node() wants a correct hash */ -  orig->hash = hash; -  +     if (orig->tree_info & OPT_NOT_SHARED) {    /* No need to have this node in the hash-table. */    /* add_node(orig); */    return check_node_hash(dmalloc_touch(node *, orig));    }    -  +  /* free_node() wants a correct hash */ +  orig->hash = hash = hash_node(orig); +     /* Mark this node as a possible duplicate */    orig->node_info |= OPT_DEFROSTED;    /* Make sure we don't find ourselves */
566:    if(car_is_node(tmp)) _CAR(tmp)=0;    if(cdr_is_node(tmp)) _CDR(tmp)=0;   #ifdef SHARED_NODES +  if (!(tmp->tree_info & OPT_NOT_SHARED)) {    tmp->hash = hash_node(tmp); -  +  }   #ifdef PIKE_DEBUG    if (l_flag > 3) {    fprintf(stderr, "Freeing node that had %d refs.\n",
609: Inside #if defined(SHARED_NODES) and #if defined(PIKE_DEBUG)
   if(l_flag>9)    print_tree(n);    -  { +  if (!(n->tree_info & OPT_NOT_SHARED)) {    size_t hash;    if ((hash = hash_node(n)) != n->hash) {    fprintf(stderr, "Hash-value is bad 0x%08lx != 0x%08lx\n",
633: Inside #if defined(PIKE_DEBUG)
   print_tree(n);      #ifdef SHARED_NODES -  { +  if (!(n->tree_info & OPT_NOT_SHARED)) {    size_t hash;    if ((hash = hash_node(n)) != n->hash) {    fprintf(stderr, "Hash-value is bad 0x%08lx != 0x%08lx\n",
780:   node *debug_check_node_hash(node *n)   {   #if defined(PIKE_DEBUG) && defined(SHARED_NODES) -  if (n && (n->hash != hash_node(n))) { +  if (n && !(n->tree_info & OPT_NOT_SHARED) && (n->hash != hash_node(n))) {    fprintf(stderr,"Bad node hash at %p, (%s:%d) (token=%d).\n",    n, n->current_file->str, n->line_number,    n->token);
1072: Inside #if defined(SHARED_NODES)
   res->type=get_type_of_svalue( & res->u.sval);   #ifdef SHARED_NODES    res->refs = 1; -  res->hash = hash_node(res); +  /* res->hash = hash_node(res); */   #endif /* SHARED_NODES */       return res;
3223:    _CAR(n) = mkintnode(0);    copy_shared_string(n->type, CAR(n)->type);   #ifdef SHARED_NODES +  if (!(n->tree_info & OPT_NOT_SHARED)) {    n->hash = hash_node(n); -  +  }    n->node_info |= OPT_DEFROSTED;    add_node(n);   #endif /* SHARED_NODES */
4291:   #endif /* SHARED_NODES */    _CAR(n) = eval(CAR(n));   #ifdef SHARED_NODES -  n->hash = hash_node(n); +     n->node_info |= OPT_DEFROSTED; -  +  if (!(n->tree_info & OPT_NOT_SHARED)) { +  n->hash = hash_node(n);    add_node(n); -  +  }   #endif /* SHARED_NODES */    if(CAR(n)) CAR(n)->parent = n;    zapp_try_optimize(CAR(n)); /* avoid infinite loops */
4313:   #endif /* SHARED_NODES */    _CDR(n) = eval(CDR(n));   #ifdef SHARED_NODES -  n->hash = hash_node(n); +     n->node_info |= OPT_DEFROSTED; -  +  if (!(n->tree_info & OPT_NOT_SHARED)) { +  n->hash = hash_node(n);    add_node(n); -  +  }   #endif /* SHARED_NODES */    if(CDR(n)) CDR(n)->parent = n;    zapp_try_optimize(CDR(n)); /* avoid infinite loops */
4375:    }      #ifdef SHARED_NODES +  n->parent->node_info |= OPT_DEFROSTED; +  if (!(n->tree_info & OPT_NOT_SHARED)) {    n->parent->hash = hash_node(n->parent);    add_node(n->parent); -  n->parent->node_info |= OPT_DEFROSTED; +  }   #endif /* SHARED_NODES */       if(tmp1)