pike.git / src / docode.c

version» Context lines:

pike.git/src/docode.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: docode.c,v 1.25 1998/01/25 08:25:05 hubbe Exp $"); + RCSID("$Id: docode.c,v 1.26 1998/01/29 00:30:33 hubbe Exp $");   #include "las.h"   #include "program.h"   #include "language.h"   #include "pike_types.h"   #include "stralloc.h"   #include "interpret.h"   #include "constants.h"   #include "array.h"   #include "pike_macros.h"   #include "error.h"   #include "memory.h"   #include "svalue.h"   #include "main.h"   #include "lex.h"   #include "builtin_functions.h"   #include "peep.h"   #include "docode.h"   #include "operators.h" -  + #include "object.h"      INT32 current_break=-1;   INT32 current_continue=-1;      static INT32 current_switch_case;   static INT32 current_switch_default;   static INT32 current_switch_values_on_stack;   static INT32 *current_switch_jumptable =0;      void upd_int(int offset, INT32 tmp)
pike.git/src/docode.c:661:    {    emit2(F_MARK);    do_docode(CDR(n),0);    tmp1=store_constant(& CAR(n)->u.sval,    !(CAR(n)->tree_info & OPT_EXTERNAL_DEPEND));    emit(F_APPLY,tmp1);    }    if(n->type == void_type_string) return 0;    return 1;    }else{ -  if(CAR(n)->u.sval.u.object == &fake_object) +  if(CAR(n)->u.sval.u.object->next == fake_object)    {    emit2(F_MARK);    do_docode(CDR(n),0);    emit(F_CALL_LFUN, CAR(n)->u.sval.subtype);    return 1;    }    }    }       emit2(F_MARK);
pike.git/src/docode.c:1017:    return 1;       case T_STRING:    tmp1=store_prog_string(n->u.sval.u.string);    emit(F_STRING,tmp1);    return 1;       case T_FUNCTION:    if(n->u.sval.subtype!=FUNCTION_BUILTIN)    { -  if(n->u.sval.u.object == &fake_object) +  if(n->u.sval.u.object == fake_object)    {    emit(F_LFUN,n->u.sval.subtype);    return 1;    } -  +  +  if(n->u.sval.u.object->next == n->u.sval.u.object) +  { +  int x=0; +  struct object *o; +  +  for(o=fake_object->parent;o!=n->u.sval.u.object;o=o->parent) +  x++; +  emit(F_LDA, x); +  emit(F_EXTERNAL, n->u.sval.subtype); +  return 1;    } -  +  }    -  + #ifdef DEBUG +  case T_OBJECT: +  if(n->u.sval.u.object->next == n->u.sval.u.object) +  fatal("Internal error: Pointer to parent cannot be a compile time constant!\n"); + #endif +     default:    tmp1=store_constant(&(n->u.sval),!(n->tree_info & OPT_EXTERNAL_DEPEND));    emit(F_CONSTANT,tmp1);    return 1;       case T_ARRAY:    case T_MAPPING:    case T_MULTISET:    tmp1=store_constant(&(n->u.sval),!(n->tree_info & OPT_EXTERNAL_DEPEND));    emit(F_CONSTANT,tmp1);