pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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: interpret.c,v 1.175 2000/12/01 01:14:58 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.176 2000/12/01 08:09:48 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h" - #include "error.h" + #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"   #include "pike_macros.h"   #include "multiset.h"   #include "backend.h"   #include "operators.h"   #include "opcodes.h"   #include "main.h"   #include "lex.h"
pike.git/src/interpret.c:75:   PMOD_EXPORT struct Pike_interpreter Pike_interpreter;   PMOD_EXPORT int stack_size = EVALUATOR_STACK_SIZE;         /* mark stack, used to store markers into the normal stack */   int mark_stack_malloced = 0;      void push_sp_mark(void)   {    if(Pike_mark_sp == Pike_interpreter.mark_stack + stack_size) -  error("No more mark stack!\n"); +  Pike_error("No more mark stack!\n");    *Pike_mark_sp++=Pike_sp;   }   ptrdiff_t pop_sp_mark(void)   {   #ifdef PIKE_DEBUG    if(Pike_mark_sp < Pike_interpreter.mark_stack)    fatal("Mark stack underflow!\n");   #endif    return Pike_sp - *--Pike_mark_sp;   }
pike.git/src/interpret.c:215:    * object[index] : { object, index }    * local variable : { svalue_pointer, nothing }    * global variable : { svalue_pointer/short_svalue_pointer, nothing }    */      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)) -  error("Index permission denied.\n"); +  Pike_error("Index permission denied.\n");   #endif    switch(lval->type)    {    case T_ARRAY_LVALUE:    {    INT32 e;    struct array *a;    ONERROR err;    a=allocate_array(lval[1].u.array->size>>1);    SET_ONERROR(err, do_free_array, a);
pike.git/src/interpret.c:280:    else    index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n");    }   }      PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from)   {   #ifdef PIKE_SECURITY    if(lval->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) -  error("Assign index permission denied.\n"); +  Pike_error("Assign index permission denied.\n");   #endif       switch(lval->type)    {    case T_ARRAY_LVALUE:    {    INT32 e;    if(from->type != T_ARRAY) -  error("Trying to assign combined lvalue from non-array.\n"); +  Pike_error("Trying to assign combined lvalue from non-array.\n");       if(from->u.array->size < (lval[1].u.array->size>>1)) -  error("Not enough values for multiple assign.\n"); +  Pike_error("Not enough values for multiple assign.\n");       if(from->u.array->size > (lval[1].u.array->size>>1)) -  error("Too many values for multiple assign.\n"); +  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:    assign_svalue(lval->u.lval,from);    break;   
pike.git/src/interpret.c:342:    else    index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n");    }   }      union anything *get_pointer_if_this_type(struct svalue *lval, TYPE_T t)   {   #ifdef PIKE_SECURITY    if(lval->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX)) -  error("Assign index permission denied.\n"); +  Pike_error("Assign index permission denied.\n");   #endif       switch(lval->type)    {    case T_ARRAY_LVALUE:    return 0;       case T_LVALUE:    if(lval->u.lval->type == t) return & ( lval->u.lval->u );    return 0;
pike.git/src/interpret.c:445:      PMOD_EXPORT void find_external_context(struct external_variable_context *loc,    int arg2)   {    struct program *p;    INT32 e,off;    TRACE((4, "-find_external_context(%d, inherit=%ld)\n", arg2,    DO_NOT_WARN((long)(loc->o->prog ? loc->inherit - loc->o->prog->inherits : 0))));       if(!loc->o) -  error("Current object is destructed\n"); +  Pike_error("Current object is destructed\n");       while(--arg2>=0)    {   #ifdef PIKE_DEBUG    if(t_flag>8 && loc->o->prog)    my_describe_inherit_structure(loc->o->prog);   #endif       TRACE((4,"- i->parent_offset=%d i->parent_identifier=%d\n",    loc->inherit->parent_offset,
pike.git/src/interpret.c:500:    break;       case -18:    TRACE((5,"- Following o->parent\n"));    loc->parent_identifier=loc->o->parent_identifier;    loc->o=loc->o->parent;    break;    }       if(!loc->o) -  error("Parent was lost during cloning.\n"); +  Pike_error("Parent was lost during cloning.\n");       if(!(p=loc->o->prog)) -  error("Attempting to access variable in destructed object\n"); +  Pike_error("Attempting to access variable in destructed object\n");      #ifdef DEBUG_MALLOC    if (loc->o->refs == 0x55555555) {    fprintf(stderr, "The object %p has been zapped!\n", loc->o);    describe(p);    fatal("Object zapping detected.\n");    }    if (p->refs == 0x55555555) {    fprintf(stderr, "The program %p has been zapped!\n", p);    describe(p);
pike.git/src/interpret.c:925:    case APPLY_SVALUE:    apply_svalue:    {    struct svalue *s=(struct svalue *)arg1;    switch(s->type)    {    case T_INT:    if (!s->u.integer) {    PIKE_ERROR("0", "Attempt to call the NULL-value\n", Pike_sp, args);    } else { -  error("Attempt to call the value %d\n", s->u.integer); +  Pike_error("Attempt to call the value %d\n", s->u.integer);    }       case T_STRING:    if (s->u.string->len > 20) { -  error("Attempt to call the string \"%20s\"...\n", s->u.string->str); +  Pike_error("Attempt to call the string \"%20s\"...\n", s->u.string->str);    } else { -  error("Attempt to call the string \"%s\"\n", s->u.string->str); +  Pike_error("Attempt to call the string \"%s\"\n", s->u.string->str);    }    case T_MAPPING: -  error("Attempt to call a mapping\n"); +  Pike_error("Attempt to call a mapping\n");    default: -  error("Call to non-function value type:%s.\n", +  Pike_error("Call to non-function value type:%s.\n",    get_name_of_type(s->type));       case T_FUNCTION:    if(s->subtype == FUNCTION_BUILTIN)    {   #ifdef PIKE_DEBUG    struct svalue *expected_stack = Pike_sp-args;    if(t_flag>1)    {    init_buf();
pike.git/src/interpret.c:1290:    struct svalue **save_mark_sp=Pike_mark_sp;    tailrecurse=eval_instruction(pc);    Pike_mark_sp=save_mark_sp;   #ifdef PIKE_DEBUG    if(Pike_mark_sp < save_mark_sp)    fatal("Popped below save_mark_sp!\n");   #endif    }   #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack) -  fatal("Stack error (also simple).\n"); +  fatal("Stack Pike_error (also simple).\n");   #endif    break;    }       }   #ifdef PROFILING   #ifdef HAVE_GETHRTIME    {    long long time_passed, time_in_children, self_time;    time_in_children= Pike_interpreter.accounted_time - children_base;
pike.git/src/interpret.c:1485:    {    ret=1;    }else{    struct svalue **save_mark_sp=Pike_mark_sp;    int tmp=eval_instruction(o->prog->program + offset);    Pike_mark_sp=save_mark_sp;    if(tmp!=-1) mega_apply(APPLY_STACK, tmp, 0,0);      #ifdef PIKE_DEBUG    if(Pike_sp<Pike_interpreter.evaluator_stack) -  fatal("Stack error (simple).\n"); +  fatal("Stack Pike_error (simple).\n");   #endif    ret=0;    }    UNSETJMP(tmp);       POP_PIKE_FRAME();       return ret;   }