Branch: Tag:

2004-12-08

2004-12-08 15:38:35 by Henrik Grubbström (Grubba) <grubba@grubba.org>

low_start_new_program() now uses new_node_s_context().
This should fix spurious fatal "Failed to free %d nodes when compiling!\n".
Also added some (disabled) diagnostics.

Rev: src/program.c:1.578

2:   || 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: program.c,v 1.577 2004/11/06 08:41:30 nilsson Exp $ + || $Id: program.c,v 1.578 2004/12/08 15:38:35 grubba Exp $   */      #include "global.h"
1637:    struct program *p;    INT32 h;    if(!id) return 0; +  +  /* fprintf(stderr, "id_to_program(%d)... ", id); */ +     h=id & (ID_TO_PROGRAM_CACHE_SIZE-1);       if((p=id_to_program_cache[h])) -  if(p->id==id) +  if(p->id==id) { +  /* fprintf(stderr, "cached: %p\n", p); */    return p; -  +  }       for(p=first_program;p;p=p->next)    {    if(id==p->id)    {    id_to_program_cache[h]=p; -  +  /* fprintf(stderr, "found: %p\n", p); */    return p;    }    }
1658:    */    char *module = NULL;    +  /* fprintf(stderr, "reserved "); */ +     switch(id) {    case PROG_PARSER_HTML_ID:    module = "Parser._parser";
1677:    break;    }    if (module) { +  /* fprintf(stderr, "%s... ", module); */    push_text(module);    SAFE_APPLY_MASTER("resolv", 1);    pop_stack();
1687:    if(id==p->id)    {    id_to_program_cache[h]=p; +  /* fprintf(stderr, "found: %p\n", p); */    return p;    }    }    }    } -  +  /* fprintf(stderr, "not found\n"); */    return 0;   }   
2088:       compilation_depth++;    +  if (!Pike_compiler->compiler_frame) { +  new_node_s_context(); +  } +     tmp.type=T_PROGRAM;    if(!p)    {