pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:19:   #include "pike_types.h"   #include "pike_memory.h"   #include "fd_control.h"   #include "cyclic.h"   #include "builtin_functions.h"   #include "module_support.h"   #include "security.h"   #include "bignum.h"   #include "operators.h"    - RCSID("$Id: opcodes.c,v 1.98 2001/01/31 15:11:28 grubba Exp $"); + RCSID("$Id: opcodes.c,v 1.99 2001/02/19 23:50:01 grubba Exp $");      void index_no_free(struct svalue *to,struct svalue *what,struct svalue *ind)   {    INT32 i;      #ifdef PIKE_SECURITY    if(what->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(what->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif
pike.git/src/opcodes.c:125:   void o_index(void)   {    struct svalue s;    index_no_free(&s,sp-2,sp-1);    pop_n_elems(2);    *sp=s;    dmalloc_touch_svalue(sp);    sp++;   }    - void o_cast(struct pike_string *type, INT32 run_time_type) + void o_cast(struct pike_type *type, INT32 run_time_type)   {    INT32 i;       if(run_time_type != sp[-1].type)    {    if(run_time_type == T_MIXED)    return;       if(sp[-1].type == T_OBJECT)    {
pike.git/src/opcodes.c:485:    }       emulated_type_ok:       if (!type) return;       switch(run_time_type)    {    case T_ARRAY:    { -  struct pike_string *itype; +  struct pike_type *itype;    INT32 run_time_itype;    -  push_string(itype=index_type(type,int_type_string,0)); +  push_type_value(itype = index_type(type, int_type_string, 0));    run_time_itype=compile_type_to_runtime_type(itype);       if(run_time_itype != T_MIXED)    {    struct array *a;    struct array *tmp=sp[-2].u.array;    DECLARE_CYCLIC();       if((a=(struct array *)BEGIN_CYCLIC(tmp,0)))    {
pike.git/src/opcodes.c:530:    END_CYCLIC();    assign_svalue(sp-3,sp-1);    pop_stack();    }    pop_stack();    }    break;       case T_MULTISET:    { -  struct pike_string *itype; +  struct pike_type *itype;    INT32 run_time_itype;    -  push_string(itype=key_type(type,0)); +  push_type_value(itype = key_type(type, 0));    run_time_itype=compile_type_to_runtime_type(itype);       if(run_time_itype != T_MIXED)    {    struct multiset *m;    struct array *tmp=sp[-2].u.multiset->ind;    DECLARE_CYCLIC();       if((m=(struct multiset *)BEGIN_CYCLIC(tmp,0)))    {
pike.git/src/opcodes.c:578:    END_CYCLIC();    assign_svalue(sp-3,sp-1);    pop_stack();    }    pop_stack();    }    break;       case T_MAPPING:    { -  struct pike_string *itype,*vtype; +  struct pike_type *itype, *vtype;    INT32 run_time_itype;    INT32 run_time_vtype;    -  push_string(itype=key_type(type,0)); +  push_type_value(itype = key_type(type, 0));    run_time_itype=compile_type_to_runtime_type(itype);    -  push_string(vtype=index_type(type,mixed_type_string,0)); +  push_type_value(vtype = index_type(type, mixed_type_string, 0));    run_time_vtype=compile_type_to_runtime_type(vtype);       if(run_time_itype != T_MIXED ||    run_time_vtype != T_MIXED)    {    struct mapping *m;    struct mapping *tmp=sp[-3].u.mapping;    DECLARE_CYCLIC();       if((m=(struct mapping *)BEGIN_CYCLIC(tmp,0)))
pike.git/src/opcodes.c:636:    pop_n_elems(2);    }    }   }         PMOD_EXPORT void f_cast(void)   {   #ifdef PIKE_DEBUG    struct svalue *save_sp=sp; -  if(sp[-2].type != T_STRING) +  if(sp[-2].type != T_TYPE)    fatal("Cast expression destroyed stack or left droppings!\n");   #endif -  o_cast(sp[-2].u.string, +  o_cast(sp[-2].u.type,    compile_type_to_runtime_type(sp[-2].u.string));   #ifdef PIKE_DEBUG    if(save_sp != sp)    fatal("Internal error: o_cast() left droppings on stack.\n");   #endif    free_svalue(sp-2);    sp[-2]=sp[-1];    sp--;    dmalloc_touch_svalue(sp);   }