pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:20:   #include "operators.h"   #include "opcodes.h"   #include "pike_embed.h"   #include "lex.h"   #include "builtin_functions.h"   #include "signal_handler.h"   #include "gc.h"   #include "threads.h"   #include "callback.h"   #include "fd_control.h" - #include "pike_security.h" +    #include "bignum.h"   #include "pike_types.h"   #include "pikecode.h"      #include <fcntl.h>   #include <errno.h>   #include <ctype.h>      #ifdef HAVE_MMAP   #ifdef HAVE_SYS_TYPES_H
pike.git/src/interpret.c:354:    * multiset[index] : { multiset, index }    * 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)    * lvalue array: { T_ARRAY_LVALUE, array with lvalue pairs }    */      int lvalue_to_svalue_no_free(struct svalue *to, struct svalue *lval)   {    int run_time_type; - #ifdef PIKE_SECURITY -  if(TYPEOF(*lval) <= MAX_COMPLEX) -  if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_INDEX)) -  Pike_error("Index permission denied.\n"); - #endif +     switch(run_time_type = TYPEOF(*lval))    {    case T_ARRAY_LVALUE:    {    INT32 e;    struct array *a;    TYPE_FIELD types = 0;    ONERROR err;    a=allocate_array(lval[1].u.array->size>>1);    SET_ONERROR(err, do_free_array, a);
pike.git/src/interpret.c:422:    if(SAFE_IS_ZERO(lval))    index_error(0,0,0,lval,lval+1,"Indexing the NULL value.\n");    else    index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n");    }    return run_time_type;   }      PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from)   { - #ifdef PIKE_SECURITY -  if(TYPEOF(*lval) <= MAX_COMPLEX) -  if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) -  Pike_error("Assign index permission denied.\n"); - #endif -  +     switch(TYPEOF(*lval))    {    case T_ARRAY_LVALUE:    {    INT32 e;    if(TYPEOF(*from) != T_ARRAY)    Pike_error("Trying to assign combined lvalue from non-array.\n");       if(from->u.array->size < (lval[1].u.array->size>>1))    Pike_error("Not enough values for multiple assign.\n");
pike.git/src/interpret.c:492:   }      /* On error callback. lvalue is followed by value to assign. */   static void o_assign_lvalue(struct svalue *lvalue)   {    assign_lvalue(lvalue, lvalue+2);   }      union anything *get_pointer_if_this_type(struct svalue *lval, TYPE_T t)   { - #ifdef PIKE_SECURITY -  if(TYPEOF(*lval) <= MAX_COMPLEX) -  if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) -  Pike_error("Assign index permission denied.\n"); - #endif -  +     switch(TYPEOF(*lval))    {    case T_ARRAY_LVALUE:    return 0;       case T_SVALUE_PTR:    dmalloc_touch_svalue(lval->u.lval);    if(TYPEOF(*(lval->u.lval)) == t) return & ( lval->u.lval->u );    return 0;   
pike.git/src/interpret.c:1941:   static int num_pike_frame_chunks;   static int num_pike_frames;      PMOD_EXPORT void really_free_pike_frame( struct pike_frame *X )   {    free_object(X->current_object);    if(X->current_program)    free_program(X->current_program);    if(X->scope)    free_pike_scope(X->scope); -  DO_IF_SECURITY( if(X->current_creds) free_object(X->current_creds) ); +     DO_IF_DEBUG(    if(X->flags & PIKE_FRAME_MALLOCED_LOCALS)    Pike_fatal("Pike frame is not supposed to have malloced locals here!\n"));    DO_IF_DMALLOC(    X->current_program=0;    X->context=0;    X->scope=0;    X->current_object=0;    X->flags=0;    X->expendible=0;    X->locals=0; -  DO_IF_SECURITY( X->current_creds=0; ) +     );    X->next = free_pike_frame;    PIKE_MEMPOOL_FREE(&free_pike_frame, X, sizeof(struct pike_frame));    free_pike_frame = X;   }      struct pike_frame *alloc_pike_frame(void)   {    struct pike_frame *res;    if( free_pike_frame )
pike.git/src/interpret.c:1975:    res = free_pike_frame;    PIKE_MEMPOOL_ALLOC(&free_pike_frame, res, sizeof(struct pike_frame));    PIKE_MEM_RW_RANGE(&res->next, sizeof(void*));    free_pike_frame = res->next;    PIKE_MEM_WO_RANGE(&res->next, sizeof(void*));    res->refs=0;    add_ref(res); /* For DMALLOC... */    res->flags=0;    res->next=0;    res->scope=0; -  -  DO_IF_SECURITY( -  if(CURRENT_CREDS) { -  add_ref(res->current_creds=CURRENT_CREDS); -  } else { -  res->current_creds = 0; -  }); -  +     return res;    }       /* Need to allocate more. */    {    unsigned int i;   #define FRAMES_PER_CHUNK ((4096*4-8-sizeof(struct pike_frame_chunk))/sizeof(struct pike_frame))   #define FRAME_CHUNK_SIZE (FRAMES_PER_CHUNK*sizeof(struct pike_frame))+sizeof(struct pike_frame_chunk)       void *p = xalloc( FRAME_CHUNK_SIZE );