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.90 1998/06/19 00:39:49 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.91 1998/07/16 19:25:43 hubbe 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:1882:    struct frame new_frame;    struct identifier *function;       if(fun<0)    {    pop_n_elems(sp-save_sp);    push_int(0);    return;    }    -  check_threads_etc(); +     check_stack(256);    check_mark_stack(256);      #ifdef DEBUG    if(d_flag>2) do_debug();   #endif    -  +  /* If we are really unlucky, o hasn't just been destructed, it has +  * also been freed! +  */ +     p=o->prog;    if(!p)    PIKE_ERROR("destructed object->function",    "Cannot call functions in destructed objects.\n", sp, args);   #ifdef DEBUG    if(fun>=(int)p->num_identifier_references)    fatal("Function index out of range.\n");   #endif       ref = p->identifier_references + fun;
pike.git/src/interpret.c:1948:       if(function->func.offset == -1)    PIKE_ERROR(function->name->str, "Calling undefined function.\n", sp, args);       tailrecurse=-1;    switch(function->identifier_flags & (IDENTIFIER_FUNCTION | IDENTIFIER_CONSTANT))    {    case IDENTIFIER_C_FUNCTION:    fp->num_args=args;    new_frame.num_locals=args; +  check_threads_etc();    (*function->func.c_fun)(args);    break;       case IDENTIFIER_CONSTANT:    {    struct svalue *s=fp->context.prog->constants+function->func.offset;    if(s->type == T_PROGRAM)    { -  struct object *tmp=parent_clone_object(s->u.program, +  struct object *tmp; +  check_threads_etc(); +  tmp=parent_clone_object(s->u.program,    o,    fun,    args);    push_object(tmp);    break;    }    /* Fall through */    }       case 0:
pike.git/src/interpret.c:2019:    }       clear_svalues(sp, num_locals - args);    sp += num_locals - args;   #ifdef DEBUG    if(num_locals < num_args)    fatal("Wrong number of arguments or locals in function def.\n");   #endif    new_frame.num_locals=num_locals;    new_frame.num_args=num_args; +  +  check_threads_etc(); +     {    struct svalue **save_mark_sp=mark_sp;    tailrecurse=eval_instruction(pc);   #ifdef DEBUG    if(mark_sp < save_mark_sp)    fatal("Popped below save_mark_sp!\n");   #endif    mark_sp=save_mark_sp;    }   #ifdef DEBUG