pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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: interpret.c,v 1.290 2003/02/15 17:33:33 grubba Exp $ + || $Id: interpret.c,v 1.291 2003/02/16 03:59:57 mast Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.290 2003/02/15 17:33:33 grubba Exp $"); + RCSID("$Id: interpret.c,v 1.291 2003/02/16 03:59:57 mast Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:279:    }   #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */   }         /*    * lvalues are stored in two svalues in one of these formats:    * array[index] : { array, index }    * mapping[index] : { mapping, index }    * multiset[index] : { multiset, index } -  * object[index] : { object, index } -  * local variable : { svalue_pointer, nothing } -  * global variable : { svalue_pointer/short_svalue_pointer, nothing } +  * object[index] : { object, index } (external object indexing) +  * local variable : { svalue pointer (T_SVALUE_PTR), nothing (T_VOID) } +  * global variable : { object, identifier index (T_OBJ_INDEX) } (internal object indexing)    */      void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval)   {   #ifdef PIKE_SECURITY    if(lval->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_INDEX))    Pike_error("Index permission denied.\n");   #endif    switch(lval->type)
pike.git/src/interpret.c:308:    a=allocate_array(lval[1].u.array->size>>1);    SET_ONERROR(err, do_free_array, a);    for(e=0;e<a->size;e++)    lvalue_to_svalue_no_free(a->item+e, lval[1].u.array->item+(e<<1));    to->type = T_ARRAY;    to->u.array=a;    UNSET_ONERROR(err);    break;    }    -  case T_LVALUE: +  case T_SVALUE_PTR:    assign_svalue_no_free(to, lval->u.lval);    break;    -  case T_SHORT_LVALUE: -  assign_from_short_svalue_no_free(to, lval->u.short_lval, -  (TYPE_T)lval->subtype); -  break; -  +     case T_OBJECT: -  +  if (lval[1].type == T_OBJ_INDEX) +  low_object_index_no_free (to, lval->u.object, lval[1].u.identifier); +  else    object_index_no_free(to, lval->u.object, lval+1);    break;       case T_ARRAY:    simple_array_index_no_free(to, lval->u.array, lval+1);    break;       case T_MAPPING:    mapping_index_no_free(to, lval->u.mapping, lval+1);    break;
pike.git/src/interpret.c:376:    Pike_error("Not enough values for multiple assign.\n");       if(from->u.array->size > (lval[1].u.array->size>>1))    Pike_error("Too many values for multiple assign.\n");       for(e=0;e<from->u.array->size;e++)    assign_lvalue(lval[1].u.array->item+(e<<1),from->u.array->item+e);    }    break;    -  case T_LVALUE: +  case T_SVALUE_PTR:    assign_svalue(lval->u.lval,from);    break;    -  case T_SHORT_LVALUE: -  assign_to_short_svalue(lval->u.short_lval, (TYPE_T)lval->subtype, from); -  break; -  +     case T_OBJECT: -  +  if (lval[1].type == T_OBJ_INDEX) +  object_low_set_index (lval->u.object, lval[1].u.identifier, from); +  else    object_set_index(lval->u.object, lval+1, from);    break;       case T_ARRAY:    simple_set_index(lval->u.array, lval+1, from);    break;       case T_MAPPING:    mapping_insert(lval->u.mapping, lval+1, from);    break;
pike.git/src/interpret.c:424: Inside #if defined(PIKE_SECURITY)
   if(lval->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX))    Pike_error("Assign index permission denied.\n");   #endif       switch(lval->type)    {    case T_ARRAY_LVALUE:    return 0;    -  case T_LVALUE: +  case T_SVALUE_PTR:    if(lval->u.lval->type == t) return & ( lval->u.lval->u );    return 0;    -  case T_SHORT_LVALUE: -  if(lval->subtype == t) return lval->u.short_lval; -  return 0; -  +     case T_OBJECT:    return object_get_item_ptr(lval->u.object,lval+1,t);       case T_ARRAY:    return array_get_item_ptr(lval->u.array,lval+1,t);       case T_MAPPING:    return mapping_get_item_ptr(lval->u.mapping,lval+1,t);       case T_MULTISET: return 0;
pike.git/src/interpret.c:2038:    args = DO_NOT_WARN((INT32) MINIMUM(f->num_args, Pike_sp - f->locals));    if(of)    args = DO_NOT_WARN((INT32)MINIMUM(f->num_args,of->locals - f->locals));    args=MAXIMUM(args,0);    }       for (i = 0; i < args; i++) {    struct svalue *arg = f->locals + i;       switch (arg->type) { -  case T_LVALUE: -  fputs ("lvalue", stderr); -  break; -  +     case T_INT:    fprintf (stderr, "%ld", (long) arg->u.integer);    break;       case T_TYPE:    /* FIXME: */    fputs("type-value", stderr);    break;       case T_STRING: {