pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.234 2001/02/19 23:50:00 grubba Exp $"); + RCSID("$Id: las.c,v 1.235 2001/02/21 18:25:24 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:471: Inside #if defined(SHARED_NODES)
   break;    }    }    if ((n->hash == hash) &&    !MEMCMP(&(n->token), &(orig->token),    sizeof(node) - OFFSETOF(node_s, token))) {    if (orig->type && (orig->type != n->type)) {    if (n->type) {    /* Use the new type if it's stricter. */    if (pike_types_le(orig->type, n->type)) { -  free_string(n->type); -  copy_shared_string(n->type, orig->type); +  free_type(n->type); +  copy_type(n->type, orig->type);    }    } else {    /* This probably doesn't happen, but... */ -  copy_shared_string(n->type, orig->type); +  copy_type(n->type, orig->type);    }    }    if (!found) {    node *scan = n;    while(scan->next) {    if (scan->next == orig) {    scan->next = orig->next;    break;    }    scan = scan->next;
pike.git/src/las.c:726:    node *dead = n;      #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (dead->refs) {    fatal("Killed node %p still has refs: %d\n", dead, dead->refs);    }   #endif /* SHARED_NODES && PIKE_DEBUG */       n = n->parent;    -  if(dead->type) free_string(dead->type); +  if(dead->type) free_type(dead->type);    if(dead->name) free_string(dead->name);   #ifdef PIKE_DEBUG    if(dead->current_file) free_string(dead->current_file);   #endif    dead->token=USHRT_MAX;    really_free_node_s(dead);    }    if (n->parent && cdr_is_node(n->parent)) {    /* Kill node and jump to the sibling. */    node *dead = n;      #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (dead->refs) {    fatal("Killed node %p still has refs: %d\n", dead, dead->refs);    }   #endif /* SHARED_NODES && PIKE_DEBUG */       n = n->parent; -  if(dead->type) free_string(dead->type); +  if(dead->type) free_type(dead->type);    if(dead->name) free_string(dead->name);   #ifdef PIKE_DEBUG    if(dead->current_file) free_string(dead->current_file);   #endif    dead->token=USHRT_MAX;    really_free_node_s(dead);      #ifdef SHARED_NODES    if (--_CDR(n)->refs) {    _CDR(n) = NULL;
pike.git/src/las.c:776:    }       /* Kill root node. */      #if defined(SHARED_NODES) && defined(PIKE_DEBUG)    if (n->refs) {    fatal("Killed node %p still has refs: %d\n", n, n->refs);    }   #endif /* SHARE_NODES && PIKE_DEBUG */    -  if(n->type) free_string(n->type); +  if(n->type) free_type(n->type);    if(n->name) free_string(n->name);   #ifdef PIKE_DEBUG    if(n->current_file) free_string(n->current_file);   #endif       n->token=USHRT_MAX;    really_free_node_s(n);    break;    } while (n->parent);   }
pike.git/src/las.c:1251:   node *debug_mkexternalnode(struct program *parent_prog, int i)   {    node *res = mkemptynode();    struct identifier *id;    res->token = F_EXTERNAL;       id = ID_FROM_INT(parent_prog, i);   #ifdef PIKE_DEBUG    if(d_flag)    { -  check_string(id->type); +  check_type_string(id->type);    check_string(id->name);    }   #endif       copy_shared_string(res->type, id->type);       /* FIXME */    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))    {    res->node_info = OPT_EXTERNAL_DEPEND;
pike.git/src/las.c:1825: Inside #if 1 /* DEAD_CODE - I need this /Hubbe */
   debug_malloc_touch(n->u.node.a);    debug_malloc_touch(n->u.node.b);    check_tree(n,0);    if(!n) return n;    switch(n->token)    {    case F_LOCAL:    case F_IDENTIFIER:    case F_TRAMPOLINE:    b=mknewintnode(0); -  if(b->type) free_string(b->type); +  if(b->type) free_type(b->type);    *b=*n; -  copy_shared_string(b->type, n->type); +  copy_type(b->type, n->type);    return b;       default:   #ifdef SHARED_NODES    n->refs++;    return n;   #else /* !SHARED_NODES */       fatal_check_c_stack(16384);   
pike.git/src/las.c:3419:    } else if (lex.pragmas & ID_STRICT_TYPES) {    yytype_error("Argument 2 to sscanf() has bad type.",    string_type_string, CDAR(n)->type, YYTE_IS_WARNING);    }    }    }    MAKE_CONSTANT_SHARED_STRING(n->type, tIntPos);    break;       case F_UNDEFINED: -  MAKE_CONSTANT_SHARED_STRING(n->type, tZero); +  copy_type(n->type, zero_type_string);    break;       case F_ARG_LIST:    if (n->parent) {    /* Propagate the changed type all the way up to the apply node. */    n->parent->node_info |= OPT_TYPE_NOT_FIXED;    }    /* FALL_THROUGH */    case F_COMMA_EXPR:    if(!CAR(n) || CAR(n)->type==void_type_string)
pike.git/src/las.c:4616:    pop_stack();    return n;    }    if (n->token == F_SOFT_CAST) {    new = mksoftcastnode(n->type, mksvaluenode(Pike_sp-1));    } else {    new = mksvaluenode(Pike_sp-1);    if (n->type && (!new->type || ((n->type != new->type) &&    pike_types_le(n->type,new->type)))) {    if (new->type) -  free_string(new->type); -  copy_shared_string(new->type,n->type); +  free_type(new->type); +  copy_type(new->type, n->type);    }    }    free_node(n);    n = new;    pop_stack();    break;       default:    if (n->token != F_SOFT_CAST) {    free_node(n);