pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.250 2001/04/08 10:11:39 hubbe Exp $"); + RCSID("$Id: las.c,v 1.251 2001/04/14 09:44:20 hubbe 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:878:    break;       case F_APPLY:    {    unsigned INT16 opt_flags = OPT_SIDE_EFFECT | OPT_EXTERNAL_DEPEND;    struct identifier *i = NULL;       if (a) {    switch(a->token) {    case F_CONSTANT: -  if (a->u.sval.type == T_FUNCTION) { -  if (a->u.sval.subtype == FUNCTION_BUILTIN) { +  switch(a->u.sval.type) +  { +  case T_FUNCTION: +  if (a->u.sval.subtype == FUNCTION_BUILTIN) +  {    opt_flags = a->u.sval.u.efun->flags;    } else if (a->u.sval.u.object->prog) {    i = ID_FROM_INT(a->u.sval.u.object->prog, a->u.sval.subtype);    } else {    yyerror("Calling function in destructed module.");    } -  +  break; +  +  case T_PROGRAM: +  if(a->u.sval.u.program->flags & PROGRAM_CONSTANT) +  opt_flags=0; +  break;    }    break;    case F_EXTERNAL:    {    struct program_state *state = Pike_compiler;    int program_id = a->u.integer.a;    while (state && (state->new_program->id != program_id)) {    state = state->previous;    }    if (state) {
pike.git/src/las.c:1828:   }      node *low_mkconstantsvaluenode(struct svalue *s)   {    node *res = mkemptynode();    res->token = F_CONSTANT;    assign_svalue_no_free(& res->u.sval, s);    if(s->type == T_OBJECT ||    (s->type==T_FUNCTION && s->subtype!=FUNCTION_BUILTIN))    { +  if(!(s->u.object->prog && (s->u.object->prog->flags & PROGRAM_CONSTANT)))    res->node_info|=OPT_EXTERNAL_DEPEND;    }    res->type = get_type_of_svalue(s);    return res;   }      node *debug_mkconstantsvaluenode(struct svalue *s)   {    return freeze_node(low_mkconstantsvaluenode(s));   }
pike.git/src/las.c:1870:    return make_node_from_mapping(s->u.mapping);       case T_OBJECT:    if(s->u.object == Pike_compiler->fake_object)    {    return mkefuncallnode("this_object", 0);    }    if(s->u.object->next == s->u.object)    {    int x=0; -  struct object *o; +     node *n=mkefuncallnode("this_object", 0); -  + #ifndef PARENT_INFO +  struct object *o;    for(o=Pike_compiler->fake_object;o!=s->u.object;o=o->parent)    {    n=mkefuncallnode("function_object",    mkefuncallnode("object_program",n));    } -  + #else +  struct program_state *state=Pike_compiler;; +  for(;state->fake_object!=s->u.object;state=state->previous) +  { +  state->new_program->flags |= PROGRAM_USES_PARENT; +  n=mkefuncallnode("function_object", +  mkefuncallnode("object_program",n)); +  } + #endif    return n;    }    break;       case T_FUNCTION:    {    if(s->subtype != FUNCTION_BUILTIN)    {    if(s->u.object == Pike_compiler->fake_object)    return mkidentifiernode(s->subtype);