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.184 2000/07/11 11:31:46 grubba Exp $"); + RCSID("$Id: las.c,v 1.185 2000/07/12 01:20:21 hubbe 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:96: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG   void check_tree(node *n, int depth)   {    if(!d_flag) return;    if(!n) return;    if(n->token==USHRT_MAX)    fatal("Free node in tree.\n");       check_node_hash(n);    +  switch(n->token) +  { +  case F_EXTERNAL: +  if(n->type) +  { +  int level = n->u.integer.a; +  int id_no = n->u.integer.b; +  struct program *p = parent_compilation(level); +  if (p) { +  struct identifier *id = ID_FROM_INT(p, id_no); +  if (id) { + #ifdef PIKE_DEBUG +  if(id->type != n->type) +  { +  printf("Type of external node is not matching it's identifier.\nid->type: "); +  simple_describe_type(id->type); +  printf("\nn->type : "); +  simple_describe_type(n->type); +  printf("\n"); +  +  fatal("Type of external node is not matching it's identifier.\n"); +  } + #endif +  } +  } +  } +  } +     if(d_flag<2) return;       if(!(depth & 1023))    {    node *q;    for(q=n->parent;q;q=q->parent)    if(q->parent==n)    fatal("Cyclic node structure found.\n");    }    depth++;
pike.git/src/las.c:342: Inside #if defined(SHARED_NODES)
   }    n = n->next;    }    orig->node_info &= ~OPT_DEFROSTED;    add_node(dmalloc_touch(node *, orig));    return check_node_hash(orig);   }      #else /* !SHARED_NODES */    - #define freeze_node(X) (X) + #ifdef PIKE_DEBUG + static node *freeze_node(node *orig) + { +  check_tree(orig); +  return orig; + } + #endif    -  + #define freeze_node(X) (X)   #endif /* SHARED_NODES */      void free_all_nodes(void)   {    if(!Pike_compiler->compiler_frame)    {    node *tmp;    struct node_s_block *tmp2;    int e=0;   
pike.git/src/las.c:680:    if(token != F_ARG_LIST && (a || b))    res->node_info |= OPT_TRY_OPTIMIZE;       res->tree_info |= res->node_info;      #ifdef PIKE_DEBUG    if(d_flag > 3)    verify_shared_strings_tables();   #endif    +  check_tree(res,0);    if(!Pike_compiler->num_parse_error && Pike_compiler->compiler_pass==2)    { -  check_tree(res,0); +     optimize(res);    check_tree(res,0);    }      #ifdef PIKE_DEBUG    if(d_flag > 3)    verify_shared_strings_tables();   #endif       return res;
pike.git/src/las.c:890:    check_tree(res,0);    return res;   }      node *debug_mkexternalnode(int level,    int i,    struct identifier *id)   {    node *res = mkemptynode();    res->token = F_EXTERNAL; + #ifdef PIKE_DEBUG +  if(d_flag) +  { +  check_string(id->type); +  check_string(id->name); +  } + #endif       /* Kludge */    id = ID_FROM_INT(parent_compilation(level), i);       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:2378:    case F_EXTERNAL:    {    int level = CAR(n)->u.integer.a;    int id_no = CAR(n)->u.integer.b;    struct program *p = parent_compilation(level);    name="external symbol";    if (p) {    struct identifier *id = ID_FROM_INT(p, id_no);    if (id && id->name) {    name = id->name->str; + #ifdef PIKE_DEBUG +  if(id->type != f) +  { +  printf("Type of external node is not matching it's identifier.\nid->type: "); +  simple_describe_type(id->type); +  printf("\nf : "); +  simple_describe_type(f); +  printf("\n"); +  +  fatal("Type of external node is not matching it's identifier.\n");    } -  + #endif    }    } -  +  }    break;       default:    name="unknown function";    }       if(max_args < args)    {    my_yyerror("Too many arguments to %s.",name);    }