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.728 2008/06/29 12:37:10 nilsson Exp $ + || $Id: program.c,v 1.729 2008/06/29 12:50:04 nilsson 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:1567:    {    struct program_state *p=Pike_compiler;    int n;    for(n=0;n<=c->compilation_depth;n++,p=p->previous)    {    int i;    if(see_inherit)    {    i=really_low_find_shared_string_identifier(ident,    p->new_program, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);    if(i!=-1)    {    if ((p->flags & COMPILATION_FORCE_RESOLVE) &&    (p->compiler_pass == 2) &&    ((p->num_inherits + 1) < p->new_program->num_inherits) &&    (PTR_FROM_INT(p->new_program, i)->inherit_offset >    p->num_inherits)) {    /* Don't look up symbols inherited later, since we need to get    * the same symbol in both passes in the force_resolve mode.    */
pike.git/src/program.c:2257:    for(i=0;i<(int)p->num_identifier_references;i++)    {    if((p->identifier_references[i].id_flags & (ID_FINAL|ID_HIDDEN)) ==    ID_FINAL)    {    struct pike_string *name=ID_FROM_INT(p, i)->name;       e=find_shared_string_identifier(name,p);    if(e == -1)    e=really_low_find_shared_string_identifier(name, p, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);       if((e != i) && (e != -1))    {    my_yyerror("Illegal to redefine final identifier %S", name);    }    }    }    }      #ifdef DEBUG_MALLOC
pike.git/src/program.c:3430:       MAKE_CONST_STRING(s,"__INIT");          /* Collect references to inherited __INIT functions */    if (!(Pike_compiler->new_program->flags & PROGRAM_AVOID_CHECK)) {    for(e=Pike_compiler->new_program->num_inherits-1;e;e--)    {    int id;    if(Pike_compiler->new_program->inherits[e].inherit_level!=1) continue; -  id=low_reference_inherited_identifier(0, e, s, SEE_STATIC); +  id=low_reference_inherited_identifier(0, e, s, SEE_PROTECTED);    if(id!=-1)    {    Pike_compiler->init_node=mknode(F_COMMA_EXPR,    mkcastnode(void_type_string,    mkapplynode(mkidentifiernode(id),0)),    Pike_compiler->init_node);    }    }    }   
pike.git/src/program.c:3972:    if(p->inherits[e].inherit_level!=1) continue;    if(!p->inherits[e].name) continue;       if(super_name)    if(super_name != p->inherits[e].name)    continue;       id=low_reference_inherited_identifier(0,    e,    function_name, -  SEE_STATIC); +  SEE_PROTECTED);       if(id!=-1)    return mkidentifiernode(id);       if(ISCONSTSTR(function_name,"`->") ||    ISCONSTSTR(function_name,"`[]"))    {    return mknode(F_MAGIC_INDEX,mknewintnode(e),mknewintnode(0));    }   
pike.git/src/program.c:4014:       for(e=p->num_inherits-1;e>0;e--)    {    if(p->inherits[e].inherit_level!=1) continue;    if(!p->inherits[e].name) continue;       if(super_name)    if(super_name != p->inherits[e].name)    continue;    -  id=low_reference_inherited_identifier(state,e,function_name,SEE_STATIC); +  id=low_reference_inherited_identifier(state,e,function_name,SEE_PROTECTED);       if(id!=-1)    return mkexternalnode(p, id);       if(ISCONSTSTR(function_name,"`->") ||    ISCONSTSTR(function_name,"`[]"))    {    return mknode(F_MAGIC_INDEX,    mknewintnode(e),mknewintnode(n+1));    }
pike.git/src/program.c:4573:    pop_stack();   }      /*    * Return the index of the identifier found, otherwise -1.    */   int isidentifier(struct pike_string *s)   {    return really_low_find_shared_string_identifier(s,    Pike_compiler->new_program, -  SEE_STATIC|SEE_PRIVATE); +  SEE_PROTECTED|SEE_PRIVATE);   }      /* Define an alias for a (possibly extern) identifier.    *    * Note that both type and name may be NULL. If they are NULL    * they will be defaulted to the values from the aliased identifier.    */   int low_define_alias(struct pike_string *name, struct pike_type *type,    int flags, int depth, int refno)   {
pike.git/src/program.c:5889:       id = -1;    depth = 0;    last_inh = prog->num_inherits;    i = (int)prog->num_identifier_references;    while(i--)    {    funp = prog->identifier_references + i;    if(funp->id_flags & ID_HIDDEN) continue;    if(funp->id_flags & ID_PROTECTED) -  if(!(flags & SEE_STATIC)) +  if(!(flags & SEE_PROTECTED))    continue;    fun = ID_FROM_PTR(prog, funp);    /* if(fun->func.offset == -1) continue; * Prototype */    if(!is_same_string(fun->name,name)) continue;    if(funp->id_flags & ID_INHERITED)    {    struct inherit *inh = INHERIT_FROM_PTR(prog, funp);    if ((funp->id_flags & ID_PRIVATE) && !(flags & SEE_PRIVATE)) continue;    if (!depth || (depth > inh->inherit_level)) {    if (id != -1) {
pike.git/src/program.c:5937:      PMOD_EXPORT int low_find_lfun(struct program *p, ptrdiff_t lfun)   {    struct pike_string *lfun_name = lfun_strings[lfun];    unsigned int flags = 0;    struct identifier *id;    int i =    really_low_find_shared_string_identifier(lfun_name,    dmalloc_touch(struct program *,    p), -  SEE_STATIC); +  SEE_PROTECTED);   #if 0    if (i < 0 || !(p->flags & PROGRAM_FIXED)) return i;    id = ID_FROM_INT(p, i);    if (IDENTIFIER_IS_PIKE_FUNCTION(id->identifier_flags) &&    (id->func.offset == -1)) {    /* Function prototype. */    return -1;    }   #endif /* 0 */    return i;