pike.git / src / las.c

version» Context lines:

pike.git/src/las.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: las.c,v 1.329 2003/03/09 13:10:40 grubba Exp $ + || $Id: las.c,v 1.330 2003/03/14 15:50:44 grubba Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.329 2003/03/09 13:10:40 grubba Exp $"); + RCSID("$Id: las.c,v 1.330 2003/03/14 15:50:44 grubba Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:530: Inside #if defined(SHARED_NODES)
   /* Propagate the line-number information. */    n->line_number = orig->line_number;    if (orig->current_file) {    if (n->current_file) {    free_string(n->current_file);    }    n->current_file = orig->current_file;    orig->current_file = NULL;    }    free_node(dmalloc_touch(node *, orig)); -  n->refs++; +  add_ref(n);    return check_node_hash(dmalloc_touch(node *, n));    }    n = n->next;    }    orig->node_info &= ~OPT_DEFROSTED;    if (!found) {    add_node(dmalloc_touch(node *, orig));    }    check_tree(orig,0);    return check_node_hash(orig);
pike.git/src/las.c:654:    /* MEMSET(node_hash.table, 0, sizeof(node *) * node_hash.size); */   #endif /* SHARED_NODES */    }   }      void debug_free_node(node *n)   {    if(!n) return;      #ifdef SHARED_NODES -  if (--n->refs) { +  if (sub_ref(n)) {   #ifdef PIKE_DEBUG    if(l_flag>9)    print_tree(n);       if (!(n->tree_info & (OPT_NOT_SHARED | OPT_DEFROSTED))) {    size_t hash;    if ((hash = hash_node(n)) != n->hash) {    fprintf(stderr, "Hash-value is bad 0x%08lx != 0x%08lx\n",    DO_NOT_WARN((unsigned long)hash),    DO_NOT_WARN((unsigned long)n->hash));
pike.git/src/las.c:723:       case F_CONSTANT:    free_svalue(&(n->u.sval));    break;    }       if (car_is_node(n)) {    /* Free CAR */      #ifdef SHARED_NODES -  if (--_CAR(n)->refs) { +  if (sub_ref(_CAR(n))) {    _CAR(n) = NULL;    } else {   #endif /* SHARED_NODES */    _CAR(n)->parent = n;    n = _CAR(n);    _CAR(n->parent) = NULL;    continue;   #ifdef SHARED_NODES    }   #endif /* SHARED_NODES */    }    if (cdr_is_node(n)) {    /* Free CDR */      #ifdef SHARED_NODES -  if (--_CDR(n)->refs) { +  if (sub_ref(_CDR(n))) {    _CDR(n) = NULL;    } else {   #endif /* SHARED_NODES */    _CDR(n)->parent = n;    n = _CDR(n);    _CDR(n->parent) = NULL;    continue;   #ifdef SHARED_NODES    }   #endif /* SHARED_NODES */
pike.git/src/las.c:788:   #endif /* SHARED_NODES && PIKE_DEBUG */       n = n->parent;    if(dead->type) free_type(dead->type);    if(dead->name) free_string(dead->name);    if(dead->current_file) free_string(dead->current_file);    dead->token=USHRT_MAX;    really_free_node_s(dead);      #ifdef SHARED_NODES -  if (--_CDR(n)->refs) { +  if (sub_ref(_CDR(n))) {    _CDR(n) = NULL;    goto backtrack;    } else {   #endif /* SHARED_NODES */    _CDR(n)->parent = n;    n = _CDR(n);    _CDR(n->parent) = NULL;    continue;   #ifdef SHARED_NODES    }
pike.git/src/las.c:845:      /* here starts routines to make nodes */   static node *debug_mkemptynode(void)   {    node *res=alloc_node_s();      #if defined(SHARED_NODES) || defined(__CHECKER__)    MEMSET(res, 0, sizeof(node));   #ifdef SHARED_NODES    res->hash = 0; -  res->refs = 1; +  res->refs = 0; +  add_ref(res); /* For DMALLOC... */   #endif /* SHARED_NODES */   #endif /* SHARED_NODES || __CHECKER__ */       res->token=0;    res->line_number=lex.current_line;    copy_shared_string(res->current_file, lex.current_file);    res->type=0;    res->name=0;    res->node_info=0;    res->tree_info=0;
pike.git/src/las.c:1204:   {    node *res = mkemptynode();    res->token = F_CONSTANT;    res->node_info = OPT_NOT_SHARED;    res->tree_info = OPT_NOT_SHARED;    res->u.sval.type = T_INT;    res->u.sval.subtype = NUMBER_NUMBER;    res->u.sval.u.integer = nr;    res->type=get_type_of_svalue( & res->u.sval);   #ifdef SHARED_NODES -  res->refs = 1; +  res->refs = 0; +  add_ref(res); /* For DMALLOC... */    /* res->hash = hash_node(res); */   #endif /* SHARED_NODES */       return res;   }      node *debug_mkfloatnode(FLOAT_TYPE foo)   {    node *res = mkemptynode();    res->token = F_CONSTANT;
pike.git/src/las.c:1926:    {    if (node_name) {    my_yyerror("Index '%s' not present in module '%s'.",    id->str, node_name);    } else {    my_yyerror("Index '%s' not present in module.", id->str);    }       if (thrown.type != PIKE_T_UNKNOWN) {    *(Pike_sp++) = thrown; +  dmalloc_touch_svalue(Pike_sp-1);    thrown.type = PIKE_T_INT;    low_safe_apply_handler("compile_exception", error_handler, compat_handler, 1);    if (SAFE_IS_ZERO(Pike_sp-1)) yy_describe_exception(&thrown);    pop_stack();    }    }else if (!force_resolve) {    /* Hope it's there in pass 2 */    pop_stack();   #if 0    fprintf(stderr, "Placeholder deployed when indexing ");
pike.git/src/las.c:2166:    case F_IDENTIFIER:    case F_TRAMPOLINE:    b=mknewintnode(0);    if(b->type) free_type(b->type);    *b=*n;    copy_pike_type(b->type, n->type);    return b;       default:   #ifdef SHARED_NODES -  n->refs++; +  add_ref(n);    return n;   #else /* !SHARED_NODES */       fatal_check_c_stack(16384);       switch((car_is_node(n) << 1) | cdr_is_node(n))    {    default: Pike_fatal("fooo?\n");       case 3: