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.766 2009/08/17 11:41:33 grubba Exp $ + || $Id: program.c,v 1.767 2009/08/18 15:56:11 grubba Exp $   */      #include "global.h"   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "lex.h"
pike.git/src/program.c:1321:    NAME[state->new_program->PIKE_CONCAT(num_,NAME)++]=(ARG); \   } \   void PIKE_CONCAT(low_add_many_to_,NAME) (struct program_state *state, \    TYPE *ARG, NUMTYPE cnt) { \    NUMTYPE m = state->malloc_size_program->PIKE_CONCAT(num_,NAME); \    CHECK_FOO(NUMTYPE,TYPE,NAME); \    if((m + cnt) > state->new_program->PIKE_CONCAT(num_,NAME)) { \    TYPE *tmp; \    NUMTYPE n = m; \    do { \ -  n = MINIMUM(n*2+1,MAXVARS(NUMTYPE)); \ +     if(n==MAXVARS(NUMTYPE)) { \    yyerror("Too many " #NAME "."); \    return; \    } \ -  +  n = MINIMUM(n*2+1,MAXVARS(NUMTYPE)); \    } while (m + cnt > n); \    m = n; \    tmp = mexec_realloc((void *)state->new_program->NAME, \    sizeof(TYPE) * m); \    if(!tmp) Pike_fatal("Out of memory.\n"); \    PIKE_CONCAT(RELOCATE_,NAME)(state->new_program, tmp); \    state->malloc_size_program->PIKE_CONCAT(num_,NAME)=m; \    state->new_program->NAME=tmp; \    } \    MEMCPY(state->new_program->NAME + \
pike.git/src/program.c:1354:   #define BAR(NUMTYPE,TYPE,ARGTYPE,NAME) \    FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \    void PIKE_CONCAT(low_add_many_to_,NAME) (struct program_state *state, \    TYPE *ARG, NUMTYPE cnt) { \    NUMTYPE m = state->malloc_size_program->PIKE_CONCAT(num_,NAME); \    CHECK_FOO(NUMTYPE,TYPE,NAME); \    if((m + cnt) > state->new_program->PIKE_CONCAT(num_,NAME)) { \    TYPE *tmp; \    NUMTYPE n = m; \    do { \ -  n = MINIMUM(n*2+1,MAXVARS(NUMTYPE)); \ +     if(n==MAXVARS(NUMTYPE)) { \    yyerror("Too many " #NAME "."); \    return; \    } \ -  +  n = MINIMUM(n*2+1,MAXVARS(NUMTYPE)); \    } while (m + cnt > n); \    m = n; \    tmp = realloc((void *)state->new_program->NAME, \    sizeof(TYPE) * m); \    if(!tmp) Pike_fatal("Out of memory.\n"); \    PIKE_CONCAT(RELOCATE_,NAME)(state->new_program, tmp); \    state->malloc_size_program->PIKE_CONCAT(num_,NAME)=m; \    state->new_program->NAME=tmp; \    } \    MEMCPY(state->new_program->NAME + \
pike.git/src/program.c:2081:    /* No need to do anything for ourselves. */    if (ref == new_ref) continue;       /* Do not zapp hidden identifiers */    if(ref->id_flags & ID_HIDDEN) continue;       /* Do not zapp functions with the wrong name... */    if((i = ID_FROM_PTR(Pike_compiler->new_program, ref))->name != name)    continue;    -  /* Do not zapp inherited inline ('local') identifiers */ -  if((ref->id_flags & (ID_INLINE|ID_INHERITED)) == (ID_INLINE|ID_INHERITED)) { +  /* Do not zapp inherited inline ('local') identifiers, +  * or inherited externals with new externals, +  * since this makes it hard to identify in encode_value(). +  */ +  if((ref->id_flags & (ID_INLINE|ID_INHERITED)) == (ID_INLINE|ID_INHERITED) +  || (ref->id_flags & new_ref->id_flags & ID_EXTERN)) {    /* But we still need to hide them, since we shadow them... */    ref->id_flags |= ID_HIDDEN;    continue;    }      #ifdef PROGRAM_BUILD_DEBUG    fprintf(stderr, "%.*soverloaded reference %d (id_flags:0x%04x)\n",    c->compilation_depth, "", cur_id, ref->id_flags);   #endif