pike.git / src / program.c

version» Context lines:

pike.git/src/program.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: program.c,v 1.520 2003/08/21 15:56:36 grubba Exp $ + || $Id: program.c,v 1.521 2003/08/21 22:09:30 mast Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.520 2003/08/21 15:56:36 grubba Exp $"); + RCSID("$Id: program.c,v 1.521 2003/08/21 22:09:30 mast Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:1010: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG   static void debug_add_to_identifiers (struct identifier id)   {    if (d_flag) {    int i;    for (i = 0; i < Pike_compiler->new_program->num_identifiers; i++)    if (Pike_compiler->new_program->identifiers[i].name == id.name) {    dump_program_tables (Pike_compiler->new_program, 0);    Pike_fatal ("Adding identifier twice, old at %d.\n", i);    } -  if (Pike_compiler->new_program->id == 65600) { -  fprintf(stderr, "Adding \"%s\"\n", -  id.name?id.name->str:"NULL"); +     } -  } +     add_to_identifiers (id);   }   #else   #define debug_add_to_identifiers(ARG) add_to_identifiers(ARG)   #endif      void add_relocated_int_to_program(INT32 i)   {    add_to_relocations(Pike_compiler->new_program->num_program);    ins_int(i, (void (*)(char))add_to_program);
pike.git/src/program.c:4045:    }   #endif      #ifdef PIKE_DEBUG    if(name!=debug_findstring(name))    Pike_fatal("define_constant on nonshared string.\n");   #endif       n = isidentifier(name);    -  do { +     if(   #if 1    c &&   #endif    c->type == T_FUNCTION &&    c->subtype != FUNCTION_BUILTIN &&    c->u.object->prog)    {    struct reference *idref = PTR_FROM_INT(c->u.object->prog, c->subtype);    struct program *p = PROG_FROM_PTR(c->u.object->prog, idref);    struct identifier *id = p->identifiers + idref->identifier_offset;    if(c->u.object->prog == Pike_compiler->new_program) {    /* Alias for a symbol in the current program.    */    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags) &&    id->func.offset != -1) {    c=& p->constants[id->func.offset].sval;    } -  else if (IDENTIFIER_IS_FUNCTION(id->identifier_flags) { +  else if (IDENTIFIER_IS_FUNCTION(id->identifier_flags)) {    if (!idref->inherit_offset) {    /* Alias for a function defined in this program. */    /* FIXME: Does this work for forward references? */    return define_function(name,    id->type,    flags,    id->identifier_flags | IDENTIFIER_ALIAS,    & id->func,    id->opt_flags);    } else if (Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE) {
pike.git/src/program.c:4108:    }    }       if(   #if 1    c &&   #endif    !svalues_are_constant(c,1,BIT_MIXED,0))    yyerror("Constant values may not have references to this.");    -  }while(0); -  +     if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE)    {    if(n==-1   #if 1    || !c   #endif    )    {    yyerror("Pass2: Constant disappeared!");    }else{