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.140 2000/04/12 18:40:12 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.141 2000/04/17 17:52:13 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:834:    {    pop_n_elems(sp-save_sp);    push_int(0);    return;    }       check_stack(256);    check_mark_stack(256);    check_c_stack(8192);    -  new_frame=alloc_pike_frame(); -  debug_malloc_touch(new_frame); +       #ifdef PIKE_DEBUG    if(d_flag>2) do_debug();   #endif       p=o->prog;    if(!p)    PIKE_ERROR("destructed object->function",    "Cannot call functions in destructed objects.\n", sp, args); -  +  + #ifdef PIKE_SECURITY +  CHECK_DATA_SECURITY_OR_ERROR(o, SECURITY_BIT_CALL, +  ("Function call permission denied.\n")); +  +  if(!CHECK_DATA_SECURITY(o, SECURITY_BIT_NOT_SETUID)) +  SET_CURRENT_CREDS(o->prot); + #endif +  +    #ifdef PIKE_DEBUG    if(fun>=(int)p->num_identifier_references)    {    fprintf(stderr, "Function index out of range. %d >= %d\n",    fun, (int)p->num_identifier_references);    fprintf(stderr,"########Program is:\n");    describe(p);    fprintf(stderr,"########Object is:\n");    describe(o);    fatal("Function index out of range.\n");    }   #endif       ref = p->identifier_references + fun;   #ifdef PIKE_DEBUG    if(ref->inherit_offset>=p->num_inherits)    fatal("Inherit offset out of range in program.\n");   #endif       /* init a new evaluation pike_frame */ -  +  new_frame=alloc_pike_frame(); +  debug_malloc_touch(new_frame); +     new_frame->next = fp;    new_frame->current_object = o;    new_frame->context = p->inherits[ ref->inherit_offset ];       function = new_frame->context.prog->identifiers + ref->identifier_offset;    -  +    #ifdef PIKE_DEBUG    if(t_flag > 9)    {    fprintf(stderr,"-- ref: inoff=%d idoff=%d flags=%d\n",    ref->inherit_offset,    ref->identifier_offset,    ref->id_flags);       fprintf(stderr,"-- context: prog->id=%d inlev=%d idlev=%d pi=%d po=%d so=%d name=%s\n",    new_frame->context.prog->id,
pike.git/src/interpret.c:895: Inside #if defined(PIKE_DEBUG)
   new_frame->context.storage_offset,    new_frame->context.name ? new_frame->context.name->str : "NULL");    if(t_flag>19)    {    describe(new_frame->context.prog);    }    }   #endif       - #ifdef PIKE_SECURITY -  CHECK_DATA_SECURITY_OR_ERROR(o, SECURITY_BIT_CALL, -  ("Function call permission denied.\n")); -  -  if(!CHECK_DATA_SECURITY(o, SECURITY_BIT_NOT_SETUID)) -  SET_CURRENT_CREDS(o->prot); - #endif -  -  - #ifdef PROFILING -  function->num_calls++; - #endif -  +     new_frame->locals = sp - args;    new_frame->expendible = new_frame->locals;    new_frame->args = args;    new_frame->fun = fun;    new_frame->current_storage = o->storage+new_frame->context.storage_offset;    new_frame->pc = 0;    new_frame->scope=scope;       add_ref(new_frame->current_object);    add_ref(new_frame->context.prog);
pike.git/src/interpret.c:934:       init_buf();    sprintf(buf,"%lx->",(long)o);    my_strcat(buf);    my_strcat(function->name->str);    do_trace_call(args);    }       fp = new_frame;    + #ifdef PROFILING +  function->num_calls++; + #endif +     if(function->func.offset == -1)    generic_error(NULL, sp, args,    "Calling undefined function.\n");       tailrecurse=-1;      #ifdef PROFILING   #ifdef HAVE_GETHRTIME    self_time_base=function->total_time;   #endif