pike.git / src / las.c

version» Context lines:

pike.git/src/las.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: las.c,v 1.343 2003/11/19 17:19:29 grubba Exp $ + || $Id: las.c,v 1.344 2004/03/13 14:45:05 grubba Exp $   */      #include "global.h" - RCSID("$Id: las.c,v 1.343 2003/11/19 17:19:29 grubba Exp $"); + RCSID("$Id: las.c,v 1.344 2004/03/13 14:45:05 grubba 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:1253:    node *n;    /* Force resolving since we don't want to get tangled up in the    * placeholder object here. The problem is really that the    * placeholder purport itself to contain every identifier, which    * makes it hide the real ones in find_module_identifier. This    * kludge will fail if the class being placeholded actually contains    * these identifiers, but then again I think it's a bit odd in the    * first place to look up these efuns in the module being compiled.    * Wouldn't it be better if this function consulted    * compiler_handler->get_default_module? /mast */ -  int orig_force_resolve = force_resolve; -  force_resolve = 1; +  int orig_flags = Pike_compiler->flags; +  Pike_compiler->flags |= COMPILATION_FORCE_RESOLVE;    name = make_shared_string(function);    if(!name || !(n=find_module_identifier(name,0)))    {    free_string(name);    my_yyerror("Internally used efun undefined: %s",function); -  force_resolve = orig_force_resolve; +  Pike_compiler->flags = orig_flags;    return mkintnode(0);    }    free_string(name);    n = mkapplynode(n, args); -  force_resolve = orig_force_resolve; +  Pike_compiler->flags = orig_flags;    return n;   }      node *debug_mkopernode(char *oper_id, node *arg1, node *arg2)   {    if(arg1 && arg2)    arg1=mknode(F_ARG_LIST,arg1,arg2);       return mkefuncallnode(oper_id, arg1);   }
pike.git/src/las.c:1939:    if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE)    {    if (!exception) {    if (node_name) {    my_yyerror("Index '%s' not present in module '%s'.",    id->str, node_name);    } else {    my_yyerror("Index '%s' not present in module.", id->str);    }    } -  }else if (!force_resolve) { +  }else if (!(Pike_compiler->flags & COMPILATION_FORCE_RESOLVE)) {    /* Hope it's there in pass 2 */    pop_stack();   #if 0    fprintf(stderr, "Placeholder deployed when indexing ");    print_tree(n);    fprintf(stderr, "with %s\n", id->str);   #endif    ref_push_object(placeholder_object);    }    }
pike.git/src/las.c:5394:   #endif /* PIKE_USE_MACHINE_CODE */      #ifdef PIKE_DEBUG    if(l_flag > 3 && n)    {    fprintf(stderr,"Evaluating (tree info=%x):",n->tree_info);    print_tree(n);    }   #endif    -  if(Pike_compiler->num_parse_error) return -1; +  if(Pike_compiler->num_parse_error) { +  return -1; +  }       num_strings = prog->num_strings;    num_constants = prog->num_constants;    num_program = prog->num_program;   #ifdef PIKE_USE_MACHINE_CODE    num_relocations = prog->num_relocations;   #endif /* PIKE_USE_MACHINE_CODE */       jump = docode(dmalloc_touch(node *, n));