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 - #include <sys/types.h> - #endif +       #ifdef HAVE_SYS_MMAN_H   #include <sys/mman.h>   #endif      #ifdef MAP_NORESERVE   #define USE_MMAP_FOR_STACK   #endif   #endif   
pike.git/src/interpret.c:54:   #include "dtrace_probes.h"   #else   #include "dtrace/dtrace_probes_disabled.h"   #endif      /*    * Define the default evaluator stack size, used for just about everything.    */   #define EVALUATOR_STACK_SIZE 100000    - #define TRACE_LEN (100 + Pike_interpreter.trace_level * 10) + #define TRACE_LEN (size_t)(100 + Pike_interpreter.trace_level * 10)      /* Keep some margin on the stack space checks. They're lifted when    * handle_error runs to give it some room. */   /* Observed in 7.1: 40 was enough, 30 wasn't. */   #define SVALUE_STACK_MARGIN (100 + LOW_SVALUE_STACK_MARGIN)   /* Observed in 7.4: 11000 was enough, 10000 wasn't. */   #define C_STACK_MARGIN (20000 + LOW_C_STACK_MARGIN)      /* Another extra margin to use while dumping the raw error in    * exit_on_error, so that backtrace_frame._sprintf can be called    * then. */   #define LOW_SVALUE_STACK_MARGIN 20   #define LOW_C_STACK_MARGIN 500    - #ifdef HAVE_COMPUTED_GOTO - PIKE_OPCODE_T *fcode_to_opcode = NULL; - struct op_2_f *opcode_to_fcode = NULL; - #endif /* HAVE_COMPUTED_GOTO */ +       PMOD_EXPORT const char Pike_check_stack_errmsg[] =    "Svalue stack overflow. "    "(%ld of %ld entries on stack, needed %ld more entries)\n";   PMOD_EXPORT const char Pike_check_mark_stack_errmsg[] =    "Mark stack overflow.\n";   PMOD_EXPORT const char Pike_check_c_stack_errmsg[] =    "C stack overflow.\n";   #ifdef PIKE_DEBUG   PMOD_EXPORT const char msg_stack_error[] =    "Stack error.\n";   PMOD_EXPORT const char msg_pop_neg[] =    "Popping negative number of args.... (%"PRINTPTRDIFFT"d) \n";   #endif    -  + PMOD_EXPORT extern void check_c_stack_margin(void) + { +  check_c_stack(Pike_interpreter.c_stack_margin); + }      #ifdef PIKE_DEBUG   static char trace_buffer[2000];   #endif      #ifdef INTERNAL_PROFILING   PMOD_EXPORT unsigned long evaluator_callback_calls = 0;   #endif         int fast_check_threads_counter = 0;    - /* This is used for strapping the interpreter before the threads -  * are loaded, and when there's no support for threads. -  */ - static struct Pike_interpreter_struct static_pike_interpreter; -  - /* Pike_sp points to first unused value on stack -  * (much simpler than letting it point at the last used value.) -  */ - PMOD_EXPORT struct Pike_interpreter_struct *Pike_interpreter_pointer = -  &static_pike_interpreter; +    PMOD_EXPORT int Pike_stack_size = EVALUATOR_STACK_SIZE;    - static void do_trace_call(INT32 args, dynamic_buffer *old_buf); + static void do_trace_call(struct byte_buffer *buf, INT32 args);   static void do_trace_func_return (int got_retval, struct object *o, int fun); - static void do_trace_return (int got_retval, dynamic_buffer *old_buf); + static void do_trace_return (struct byte_buffer *buf, int got_retval); + static void do_trace_efun_call(const struct svalue *s, INT32 args); + #ifdef PIKE_DEBUG + static void do_trace_efun_return(const struct svalue *s, int got_retval); + #endif    - PMOD_EXPORT struct Pike_interpreter_struct * pike_get_interpreter_pointer() - { -  return Pike_interpreter_pointer; - } -  +    void push_sp_mark(void)   {    if(Pike_mark_sp == Pike_interpreter.mark_stack + Pike_stack_size)    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)
pike.git/src/interpret.c:152: Inside #if defined(PIKE_DEBUG)
   GC_ENTER (f, T_PIKE_FRAME) {    if (!debug_gc_check (f, " as frame on stack")) {    gc_mark_external (f->current_object, " in current_object in frame on stack");    gc_mark_external (f->current_program, " in current_program in frame on stack");    if (f->locals) { /* Check really needed? */    if (f->flags & PIKE_FRAME_MALLOCED_LOCALS) {    gc_mark_external_svalues(f->locals, f->num_locals,    " in malloced locals of trampoline frame on stack");    } else {    if (f->locals > stack_p || (stack_p - f->locals) >= 0x10000) { -  fatal("Unreasonable locals: stack:%p locals:%p\n", +  Pike_fatal("Unreasonable locals: stack:%p locals:%p\n",    stack_p, f->locals);    }    gc_mark_external_svalues (f->locals, stack_p - f->locals, " on svalue stack");    stack_p = f->locals;    }    }    }    } GC_LEAVE;    if (stack != stack_p)    gc_mark_external_svalues (stack, stack_p - stack, " on svalue stack");   }    - static void gc_check_stack_callback(struct callback *foo, void *bar, void *gazonk) + static void gc_check_stack_callback(struct callback *UNUSED(foo), void *UNUSED(bar), void *UNUSED(gazonk))   {    if (Pike_interpreter.evaluator_stack   #ifdef PIKE_DEBUG    /* Avoid this if the thread is swapped out. Useful when calling    * locate_references from gdb. */    && Pike_sp != (void *) -1   #endif    )    gc_mark_stack_external (Pike_fp, Pike_sp, Pike_interpreter.evaluator_stack);   }
pike.git/src/interpret.c:197:    * Pike_interpreter.catching_eval_jmpbuf, zero it, and restore it    * afterwards.    */   static int eval_instruction(PIKE_OPCODE_T *pc);      PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter_struct *interpreter)   {   #ifdef USE_MMAP_FOR_STACK    static int fd = -1;    - #ifndef MAP_VARIABLE - #define MAP_VARIABLE 0 - #endif -  +    #ifndef MAP_PRIVATE   #define MAP_PRIVATE 0   #endif      #ifndef MAP_FAILED   #define MAP_FAILED -1   #endif      #ifndef MAP_ANONYMOUS   #define MAP_ANONYMOUS 0
pike.git/src/interpret.c:319: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    {    static struct callback *spcb;    if(!spcb)    {    spcb=add_gc_callback(gc_check_stack_callback,0,0);    dmalloc_accept_leak(spcb);    }    }   #endif - #if defined(HAVE_COMPUTED_GOTO) || defined(PIKE_USE_MACHINE_CODE) + #ifdef PIKE_USE_MACHINE_CODE    {    static int tables_need_init=1;    if(tables_need_init) {    /* Initialize the fcode_to_opcode table / jump labels. */   #if !defined(OPCODE_INLINE_RETURN)    eval_instruction(NULL);   #endif - #if defined(PIKE_USE_MACHINE_CODE) && !defined(PIKE_DEBUG) -  /* Simple operator opcodes... */ - #define SET_INSTR_ADDRESS(X, Y) (instrs[(X)-F_OFFSET].address = (void *)Y) -  SET_INSTR_ADDRESS(F_COMPL, o_compl); -  SET_INSTR_ADDRESS(F_LSH, o_lsh); -  SET_INSTR_ADDRESS(F_RSH, o_rsh); -  SET_INSTR_ADDRESS(F_SUBTRACT, o_subtract); -  SET_INSTR_ADDRESS(F_AND, o_and); -  SET_INSTR_ADDRESS(F_OR, o_or); -  SET_INSTR_ADDRESS(F_XOR, o_xor); -  SET_INSTR_ADDRESS(F_MULTIPLY, o_multiply); -  SET_INSTR_ADDRESS(F_DIVIDE, o_divide); -  SET_INSTR_ADDRESS(F_MOD, o_mod); -  SET_INSTR_ADDRESS(F_CAST, f_cast); -  SET_INSTR_ADDRESS(F_CAST_TO_INT, o_cast_to_int); -  SET_INSTR_ADDRESS(F_CAST_TO_STRING, o_cast_to_string); -  SET_INSTR_ADDRESS(F_RANGE, o_range2); -  SET_INSTR_ADDRESS(F_SSCANF, o_sscanf); - #endif /* PIKE_USE_MACHINE_CODE && !PIKE_DEBUG */ +     tables_need_init=0;   #ifdef INIT_INTERPRETER_STATE    INIT_INTERPRETER_STATE();   #endif    }    } - #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */ + #endif /* 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 } (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 }    */    - void lvalue_to_svalue_no_free(struct svalue *to,struct svalue *lval) + int lvalue_to_svalue_no_free(struct svalue *to, struct svalue *lval)   { - #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(TYPEOF(*lval)) +  int run_time_type; +  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);    for(e=0;e<a->size;e++) {
pike.git/src/interpret.c:399:    UNSET_ONERROR(err);    break;    }       case T_SVALUE_PTR:    dmalloc_touch_svalue(lval->u.lval);    assign_svalue_no_free(to, lval->u.lval);    break;       case T_OBJECT: -  /* FIXME: Object subtypes! */ +  /* FIXME: Index subtypes! */    if (TYPEOF(lval[1]) == T_OBJ_INDEX) -  low_object_index_no_free (to, lval->u.object, lval[1].u.identifier); +  run_time_type = low_object_index_no_free(to, lval->u.object, +  lval[1].u.identifier);    else -  object_index_no_free(to, lval->u.object, SUBTYPEOF(*lval), lval+1); +  run_time_type = object_index_no_free(to, lval->u.object, +  SUBTYPEOF(*lval), 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:425:    if(multiset_member(lval->u.multiset,lval+1))    {    SET_SVAL(*to, T_INT, NUMBER_NUMBER, integer, 1);    }else{    SET_SVAL(*to, T_INT, NUMBER_UNDEFINED, integer, 0);    }    break;       default:    if(SAFE_IS_ZERO(lval)) -  index_error(0,0,0,lval,lval+1,"Indexing the NULL value.\n"); +  index_error(0,0,lval,lval+1,"Indexing the NULL value.\n");    else -  index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n"); +  index_error(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:489:       case T_MULTISET:    if(UNSAFE_IS_ZERO(from))    multiset_delete(lval->u.multiset, lval+1);    else    multiset_insert(lval->u.multiset, lval+1);    break;       default:    if(SAFE_IS_ZERO(lval)) -  index_error(0,0,0,lval,lval+1,"Indexing the NULL value.\n"); +  index_error(0,0,lval,lval+1,"Indexing the NULL value.\n");    else -  index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n"); +  index_error(0,0,lval,lval+1,"Indexing a basic type.\n");    }   }      /* 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:533:    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;       default:    if(SAFE_IS_ZERO(lval)) -  index_error(0,0,0,lval,lval+1,"Indexing the NULL value.\n"); +  index_error(0,0,lval,lval+1,"Indexing the NULL value.\n");    else -  index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n"); +  index_error(0,0,lval,lval+1,"Indexing a basic type.\n");    return 0;    }   }      #ifdef PIKE_DEBUG    - INLINE void pike_trace(int level,char *fmt, ...) ATTRIBUTE((format (printf, 2, 3))); - INLINE void pike_trace(int level,char *fmt, ...) + static inline void pike_trace(int level,char *fmt, ...) ATTRIBUTE((format (printf, 2, 3))); + static inline void pike_trace(int level,char *fmt, ...)   {    if(Pike_interpreter.trace_level > level)    {    va_list args;    va_start(args,fmt);    vsprintf(trace_buffer,fmt,args);    va_end(args);    write_to_stderr(trace_buffer,strlen(trace_buffer));    }   }
pike.git/src/interpret.c:575: Inside #if defined(PIKE_DEBUG)
   p->parent ? p->parent->id : -1);    for(e=0;e<p->num_identifier_references;e++)    {    in=INHERIT_FROM_INT(p,e);    while(last < in)    {    last++;    fprintf(stderr,    "[%ld]%*s parent{ offset=%d ident=%d id=%d } "    "id{ level=%d } prog=%d\n", -  DO_NOT_WARN((long)(last - p->inherits)), +  (long)(last - p->inherits),    last->inherit_level*2,"",    last->parent_offset,    last->parent_identifier,    last->prog->parent ? last->prog->parent->id : -1,    last->identifier_level,    last->prog->id);    i=0;    }       fprintf(stderr," %*s %d,%d: %s\n",
pike.git/src/interpret.c:624:    * struct object *o // object containing the scope.    * struct inherit *inherit // inherit in o->prog being the scope.    * int parent_identifier // identifier in o from the inherit.    */   PMOD_EXPORT void find_external_context(struct external_variable_context *loc,    int depth)   {    struct program *p;       TRACE((4, "-find_external_context(%d, inherit=%ld)\n", depth, -  DO_NOT_WARN((long)(loc->o->prog ? loc->inherit - loc->o->prog->inherits : 0)))); +  (long)(loc->o->prog ? loc->inherit - loc->o->prog->inherits : 0)));      #ifdef PIKE_DEBUG    if(!loc->o)    Pike_fatal("No object\n");   #endif       if (!(p = loc->o->prog)) {    /* magic fallback */    p = get_program_for_object_being_destructed(loc->o);    if(!p)
pike.git/src/interpret.c:799:    }    else    /* Return a valid pointer to a dummy inherit for the convenience    * of the caller. Identifier offsets will be bogus but it'll    * never get to that since the object is destructed. */    loc->inherit = &dummy_inherit;       TRACE((5,"- Parent identifier = %d (%s), inherit # = %ld\n",    loc->parent_identifier,    p ? ID_FROM_INT(p, loc->parent_identifier)->name->str : "N/A", -  p ? DO_NOT_WARN((long)(loc->inherit - p->inherits)) : -1)); +  p ? (long)(loc->inherit - p->inherits) : -1));      #ifdef DEBUG_MALLOC    if (p && loc->inherit->storage_offset == 0x55555555) {    fprintf(stderr, "The inherit %p has been zapped!\n", loc->inherit);    debug_malloc_dump_references(loc->inherit,0,2,0);    fprintf(stderr, "It was extracted from the program %p %d\n", p, loc->parent_identifier);    describe(p);    fprintf(stderr, "Which was in turn taken from the object %p\n", loc->o);    describe(loc->o);    Pike_fatal("Looks like the program %p has been zapped!\n", p);
pike.git/src/interpret.c:825:    loc->parent_identifier,    p ? ID_FROM_INT(p,loc->parent_identifier)->name->str : "N/A"    ));   }      #ifdef PIKE_DEBUG   void print_return_value(void)   {    if(Pike_interpreter.trace_level>3)    { -  char *s; -  dynamic_buffer save_buf; +  struct byte_buffer buf = BUFFER_INIT();    -  init_buf(&save_buf); -  safe_describe_svalue(Pike_sp-1,0,0); -  s=simple_free_buf(&save_buf); -  if((size_t)strlen(s) > (size_t)TRACE_LEN) +  safe_describe_svalue(&buf, Pike_sp-1,0,0); +  if(buffer_content_length(&buf) > TRACE_LEN)    { -  s[TRACE_LEN]=0; -  s[TRACE_LEN-1]='.'; -  s[TRACE_LEN-2]='.'; -  s[TRACE_LEN-3]='.'; +  buffer_remove(&buf, buffer_content_length(&buf) - TRACE_LEN); +  buffer_add_str(&buf, "...");    } -  fprintf(stderr,"- value: %s\n",s); -  free(s); +  fprintf(stderr,"- value: %s\n",buffer_get_string(&buf)); +  buffer_free(&buf);    }   }   #else   #define print_return_value()   #endif      struct callback_list evaluator_callbacks;         /*
pike.git/src/interpret.c:884: Inside #if defined(_REENTRANT)
  #ifdef _REENTRANT    struct thread_state *thread_state;   #endif    ptrdiff_t stack;    ptrdiff_t mark_stack;   };      struct backlog backlog[BACKLOG];   int backlogp=BACKLOG-1;    - static INLINE void low_debug_instr_prologue (PIKE_INSTR_T instr) + static inline void low_debug_instr_prologue (PIKE_INSTR_T instr)   {    if(Pike_interpreter.trace_level > 2)    {    char *file = NULL, *f;    struct pike_string *filep;    INT_TYPE linep;       filep = get_line(Pike_fp->pc,Pike_fp->context->prog,&linep);    if (filep && !filep->size_shift) {    file = filep->str; -  while((f=STRCHR(file,'/'))) +  while((f=strchr(file,'/')))    file=f+1;    }    fprintf(stderr,"- %s:%4ld:%p(%"PRINTPTRDIFFT"d): "    "%-25s %4"PRINTPTRDIFFT"d %4"PRINTPTRDIFFT"d\n",    file ? file : "-",(long)linep,    Pike_fp->pc, Pike_fp->pc - Pike_fp->context->prog->program,    get_opcode_name(instr),    Pike_sp-Pike_interpreter.evaluator_stack,    Pike_mark_sp-Pike_interpreter.mark_stack);    free_string(filep);    }    - #ifdef HAVE_COMPUTED_GOTO -  if (instr) -  ADD_RUNNED(instr); -  else -  Pike_fatal("NULL Instruction!\n"); - #else /* !HAVE_COMPUTED_GOTO */ +     if(instr + F_OFFSET < F_MAX_OPCODE)    ADD_RUNNED(instr); - #endif /* HAVE_COMPUTED_GOTO */ +        if(d_flag )    {    backlogp++;    if(backlogp >= BACKLOG) backlogp=0;       backlog[backlogp].program_id = Pike_fp->context->prog->id;    backlog[backlogp].instruction=instr;    backlog[backlogp].pc = Pike_fp->pc;    backlog[backlogp].stack = Pike_sp - Pike_interpreter.evaluator_stack;
pike.git/src/interpret.c:1021:    (long) backlog[backlogp].arg), \    write_to_stderr(trace_buffer,strlen(trace_buffer)) : 0))      #define DEBUG_LOG_ARG2(ARG2) \    (backlog[backlogp].arg2 = (ARG2), \    (Pike_interpreter.trace_level>3 ? \    sprintf(trace_buffer, "- Arg2 = %ld\n", \    (long) backlog[backlogp].arg2), \    write_to_stderr(trace_buffer,strlen(trace_buffer)) : 0))    - void dump_backlog(void) + PMOD_EXPORT void dump_backlog(void)   {   #ifdef _REENTRANT    struct thread_state *thread=0;   #endif       int e;    if(!d_flag || backlogp<0 || backlogp>=BACKLOG)    return;       e=backlogp;
pike.git/src/interpret.c:1053: Inside #if defined(_REENTRANT)
     #ifdef _REENTRANT    if(thread != backlog[e].thread_state)    {    fprintf(stderr,"[Thread swap, Pike_interpreter.thread_state=%p]\n",backlog[e].thread_state);    thread = backlog[e].thread_state;    }   #endif       file = get_line(backlog[e].pc,p, &line); - #ifdef HAVE_COMPUTED_GOTO -  fprintf(stderr,"%s:%ld:(%"PRINTPTRDIFFT"d): %s", -  file->str, -  (long)line, -  backlog[e].pc - p->program, -  get_opcode_name(backlog[e].instruction)); - #else /* !HAVE_COMPUTED_GOTO */ +     if(backlog[e].instruction+F_OFFSET > F_MAX_OPCODE)    {    fprintf(stderr,"%s:%ld:(%"PRINTPTRDIFFT"d): ILLEGAL INSTRUCTION %d\n",    file->str,    (long)line,    backlog[e].pc - p->program,    backlog[e].instruction + F_OFFSET);    free_string(file);    continue;    }
pike.git/src/interpret.c:1090:    (long)backlog[e].arg2);    }    else if(instrs[backlog[e].instruction].flags & I_POINTER)    {    fprintf(stderr,"(%+ld)", (long)backlog[e].arg);    }    else if(instrs[backlog[e].instruction].flags & I_HASARG)    {    fprintf(stderr,"(%ld)", (long)backlog[e].arg);    } -  fprintf(stderr," %ld, %ld\n", -  DO_NOT_WARN((long)backlog[e].stack), -  DO_NOT_WARN((long)backlog[e].mark_stack)); - #endif /* HAVE_COMPUTED_GOTO */ +  fprintf(stderr," %ld, %ld\n", (long)backlog[e].stack, +  (long)backlog[e].mark_stack);    free_string(file);    }    }while(e!=backlogp);   }      #else /* PIKE_DEBUG */      #define DEBUG_LOG_ARG(arg) 0   #define DEBUG_LOG_ARG2(arg2) 0      #endif /* !PIKE_DEBUG */    -  + #ifdef OPCODE_INLINE_CATCH   #define POP_CATCH_CONTEXT do { \    struct catch_context *cc = Pike_interpreter.catch_ctx; \    DO_IF_DEBUG ( \    TRACE((3,"- Popping catch context %p ==> %p\n", \    cc, cc ? cc->prev : NULL)); \ -  +  if (!cc) \ +  Pike_fatal ("Catch context dropoff.\n"); \ +  if (cc->frame != Pike_fp) \ +  Pike_fatal ("Catch context doesn't belong to this frame.\n"); \ +  if (Pike_mark_sp != cc->recovery.mark_sp + Pike_interpreter.mark_stack) \ +  Pike_fatal ("Mark sp diff in catch context pop.\n"); \ +  ); \ +  debug_malloc_touch (cc); \ +  UNSETJMP (cc->recovery); \ +  Pike_interpreter.catch_ctx = cc->prev; \ +  really_free_catch_context (cc); \ +  } while (0) + #else + #define POP_CATCH_CONTEXT do { \ +  struct catch_context *cc = Pike_interpreter.catch_ctx; \ +  DO_IF_DEBUG ( \ +  TRACE((3,"- Popping catch context %p ==> %p\n", \ +  cc, cc ? cc->prev : NULL)); \    if (!Pike_interpreter.catching_eval_jmpbuf) \    Pike_fatal ("Not in catching eval.\n"); \    if (!cc) \    Pike_fatal ("Catch context dropoff.\n"); \    if (cc->frame != Pike_fp) \    Pike_fatal ("Catch context doesn't belong to this frame.\n"); \    if (Pike_mark_sp != cc->recovery.mark_sp + Pike_interpreter.mark_stack) \    Pike_fatal ("Mark sp diff in catch context pop.\n"); \    ); \    debug_malloc_touch (cc); \    UNSETJMP (cc->recovery); \ -  Pike_fp->expendible = cc->save_expendible; \ +     Pike_interpreter.catch_ctx = cc->prev; \    really_free_catch_context (cc); \    } while (0) -  + #endif      static struct catch_context *free_catch_context;   static int num_catch_ctx, num_free_catch_ctx;      PMOD_EXPORT void really_free_catch_context( struct catch_context *data )   {    if( num_free_catch_ctx > 100 && free_catch_context )    {    num_catch_ctx--;    free( data );
pike.git/src/interpret.c:1163:    {    num_free_catch_ctx--;    res = free_catch_context;    PIKE_MEM_RW(res->prev);    free_catch_context = res->prev;    PIKE_MEM_WO(*res);    }    else    {    num_catch_ctx++; -  res = xalloc( sizeof( struct catch_context ) ); +  res = ALLOC_STRUCT( catch_context );    }    return res;   }      void count_memory_in_catch_contexts(size_t *num, size_t *size )   {    *num = (num_catch_ctx-num_free_catch_ctx);    *size = num_catch_ctx * (sizeof(struct catch_context)+8); /* assumes 8 bytes overhead. */   }    -  + #ifdef DO_PIKE_CLEANUP   static void free_all_catch_context_blocks(void)   {    struct catch_context *x = free_catch_context, *n;    while( x )    {    PIKE_MEM_RW(x->prev);    n = x->prev;    free( x );    x = n;    }    free_catch_context = NULL;   } -  + #endif      static int catching_eval_instruction (PIKE_OPCODE_T *pc);         #ifdef PIKE_USE_MACHINE_CODE   #ifdef OPCODE_INLINE_RETURN   /* Catch notes:    *    * Typical F_CATCH use:    *
pike.git/src/interpret.c:1248: Inside #if defined(PIKE_USE_MACHINE_CODE) and #if defined(OPCODE_INLINE_RETURN)
   }   #endif    {    struct catch_context *new_catch_ctx = alloc_catch_context();   #ifdef PIKE_DEBUG    new_catch_ctx->frame = Pike_fp;    init_recovery (&new_catch_ctx->recovery, 0, 0, PERR_LOCATION());   #else    init_recovery (&new_catch_ctx->recovery, 0);   #endif -  new_catch_ctx->save_expendible = Pike_fp->expendible; -  new_catch_ctx->continue_reladdr = ((INT32 *)addr)[0] +  new_catch_ctx->continue_reladdr = (INT32)get_unaligned32(addr)    /* We need to run the entry prologue... */    - ENTRY_PROLOGUE_SIZE;       new_catch_ctx->next_addr = addr;    new_catch_ctx->prev = Pike_interpreter.catch_ctx;    Pike_interpreter.catch_ctx = new_catch_ctx;    DO_IF_DEBUG({    TRACE((3,"- Pushed catch context %p\n", new_catch_ctx));    });    }    -  Pike_fp->expendible = Pike_fp->locals + Pike_fp->num_locals; -  +     /* Need to adjust next_addr by sizeof(INT32) to skip past the jump    * address to the continue position after the catch block. */    addr = (PIKE_OPCODE_T *) ((INT32 *) addr + 1);       if (Pike_interpreter.catching_eval_jmpbuf) {    /* There's already a catching_eval_instruction around our    * eval_instruction, so we can just continue. */    debug_malloc_touch_named (Pike_interpreter.catch_ctx, "(1)");    /* Skip past the entry prologue... */    addr += ENTRY_PROLOGUE_SIZE;
pike.git/src/interpret.c:1325: Inside #if defined(PIKE_USE_MACHINE_CODE)
      DO_IF_DEBUG ({    TRACE((3,"- Caught exception. catch context: %p\n", cc));    if (!cc) Pike_fatal ("Catch context dropoff.\n");    if (cc->frame != Pike_fp)    Pike_fatal ("Catch context doesn't belong to this frame.\n");    });       debug_malloc_touch_named (cc, "(3)");    UNSETJMP (cc->recovery); -  Pike_fp->expendible = cc->save_expendible; +     move_svalue (Pike_sp++, &throw_value);    mark_free_svalue (&throw_value);    low_destruct_objects_to_destruct();       if (cc->continue_reladdr < 0)    FAST_CHECK_THREADS_ON_BRANCH();    addr = cc->next_addr + cc->continue_reladdr;       DO_IF_DEBUG({    TRACE((3,"- Popping catch context %p ==> %p\n",
pike.git/src/interpret.c:1350: Inside #if defined(PIKE_USE_MACHINE_CODE)
   Pike_interpreter.catch_ctx = cc->prev;    really_free_catch_context (cc);    }    }       return (PIKE_OPCODE_T *)(ptrdiff_t)-1; /* INTER_RETURN; */    }   }      void *do_inter_return_label = (void*)(ptrdiff_t)-1; - #else + #else /* OPCODE_INLINE_RETURN */   /* Labels to jump to to cause eval_instruction to return */   /* FIXME: Replace these with assembler lables */   void *do_inter_return_label = NULL;   void *dummy_label = NULL; -  + #endif /* OPCODE_INLINE_RETURN */ +  + #ifdef OPCODE_INLINE_CATCH + /* Helper function for F_CATCH machine code. +  For a description of the addr argument, see inter_return_opcode_F_CATCH. +  Returns the jump destination (for the catch body). */ + PIKE_OPCODE_T *setup_catch_context(PIKE_OPCODE_T *addr) + { + #ifdef PIKE_DEBUG +  if (d_flag || Pike_interpreter.trace_level > 2) { +  low_debug_instr_prologue (F_CATCH - F_OFFSET); +  if (Pike_interpreter.trace_level>3) { +  sprintf(trace_buffer, "- Addr = %p\n", addr); +  write_to_stderr(trace_buffer,strlen(trace_buffer)); +  } +  }   #endif -  +  { +  struct catch_context *new_catch_ctx = alloc_catch_context(); + #ifdef PIKE_DEBUG +  new_catch_ctx->frame = Pike_fp; +  init_recovery (&new_catch_ctx->recovery, 0, 0, PERR_LOCATION()); + #else +  init_recovery (&new_catch_ctx->recovery, 0); + #endif    -  +  /* Note: no prologue. */ +  new_catch_ctx->continue_reladdr = (INT32)get_unaligned32(addr); +  +  new_catch_ctx->next_addr = addr; +  new_catch_ctx->prev = Pike_interpreter.catch_ctx; +  Pike_interpreter.catch_ctx = new_catch_ctx; +  DO_IF_DEBUG({ +  TRACE((3,"- Pushed catch context %p\n", new_catch_ctx)); +  }); +  } +  +  /* Need to adjust next_addr by sizeof(INT32) to skip past the jump +  * address to the continue position after the catch block. */ +  return (PIKE_OPCODE_T *) ((INT32 *) addr + 1) + ENTRY_PROLOGUE_SIZE; + } +  + /* Helper function for F_CATCH machine code. Called when an exception +  is caught. Pops the catch context and returns the continue jump +  destination. */ + PIKE_OPCODE_T *handle_caught_exception(void) + { +  /* Caught an exception. */ +  struct catch_context *cc = Pike_interpreter.catch_ctx; +  PIKE_OPCODE_T *addr; +  +  DO_IF_DEBUG ({ +  TRACE((3,"- Caught exception. catch context: %p\n", cc)); +  if (!cc) Pike_fatal ("Catch context dropoff.\n"); +  if (cc->frame != Pike_fp) +  Pike_fatal ("Catch context doesn't belong to this frame.\n"); +  }); +  +  debug_malloc_touch_named (cc, "(3)"); +  UNSETJMP (cc->recovery); +  move_svalue (Pike_sp++, &throw_value); +  mark_free_svalue (&throw_value); +  low_destruct_objects_to_destruct(); +  +  if (cc->continue_reladdr < 0) +  FAST_CHECK_THREADS_ON_BRANCH(); +  addr = cc->next_addr + cc->continue_reladdr; +  +  DO_IF_DEBUG({ +  TRACE((3,"- Popping catch context %p ==> %p\n", +  cc, cc->prev)); +  if (!addr) Pike_fatal ("Unexpected null continue addr.\n"); +  }); +  +  Pike_interpreter.catch_ctx = cc->prev; +  really_free_catch_context (cc); +  +  return addr; + } +  + #endif /* OPCODE_INLINE_CATCH */ +    #ifndef CALL_MACHINE_CODE   #define CALL_MACHINE_CODE(pc) \    do { \    /* The test is needed to get the labels to work... */ \    if (pc) { \    /* No extra setup needed! \    */ \    return ((int (*)(void))(pc))(); \    } \    } while(0)   #endif /* !CALL_MACHINE_CODE */      #ifndef EXIT_MACHINE_CODE   #define EXIT_MACHINE_CODE()   #endif      /* Intended to be called from machine code before inlined function    * calls (primarily the CALL_BUILTIN opcodes), to ensure thread    * switching. */ - void call_check_threads_etc() + void call_check_threads_etc(void)   {    FAST_CHECK_THREADS_ON_CALL();   }      #if defined(OPCODE_INLINE_BRANCH) || defined(INS_F_JUMP) || \    defined(INS_F_JUMP_WITH_ARG) || defined(INS_F_JUMP_WITH_TWO_ARGS)   /* Intended to be called from machine code on backward branch jumps,    * to ensure thread switching. */ - void branch_check_threads_etc() + void branch_check_threads_etc(void)   {    FAST_CHECK_THREADS_ON_BRANCH();   }   #endif      #ifdef PIKE_DEBUG      static void debug_instr_prologue (PIKE_INSTR_T instr)   {    low_debug_instr_prologue (instr);
pike.git/src/interpret.c:1592:   #define OPCODE1_BRANCH(O,N,F,C) TEST_OPCODE1(O,N,F,C)   #define OPCODE2_BRANCH(O,N,F,C) TEST_OPCODE2(O,N,F,C)   #define OPCODE0_TAILBRANCH(O,N,F,C) TEST_OPCODE0(O,N,F,C)   #define OPCODE1_TAILBRANCH(O,N,F,C) TEST_OPCODE1(O,N,F,C)   #define OPCODE2_TAILBRANCH(O,N,F,C) TEST_OPCODE2(O,N,F,C)      #define OPCODE0_ALIAS(O,N,F,C)   #define OPCODE1_ALIAS(O,N,F,C)   #define OPCODE2_ALIAS(O,N,F,C)    - #undef HAVE_COMPUTED_GOTO -  +    #ifdef GLOBAL_DEF_PROG_COUNTER   GLOBAL_DEF_PROG_COUNTER;   #endif      #ifndef SET_PROG_COUNTER   #define SET_PROG_COUNTER(X) (PROG_COUNTER=(X))   #endif /* SET_PROG_COUNTER */      #undef DONE   #undef FETCH
pike.git/src/interpret.c:1717:    * do_inter_return_label to be at the CALL_MACHINE_CODE below. */    else {   #endif /* !OPCODE_INLINE_RETURN */    CALL_MACHINE_CODE(pc);      #ifndef OPCODE_INLINE_RETURN    /* This code is never reached, but will    * prevent gcc from optimizing the labels below too much    */    - #ifdef PIKE_DEBUG -  fprintf(stderr,"We have reached the end of the world!\n"); - #endif +  DWERR("We have reached the end of the world!\n");    }      #ifdef __GNUC__    goto *dummy_label;   #endif       inter_return_label:   #endif /*!OPCODE_INLINE_RETURUN */   #ifdef PIKE_DEBUG    pike_trace(3, "- Inter return\n");
pike.git/src/interpret.c:1742:    return -1;   }      #else /* PIKE_USE_MACHINE_CODE */         #ifndef SET_PROG_COUNTER   #define SET_PROG_COUNTER(X) (PROG_COUNTER=(X))   #endif /* SET_PROG_COUNTER */    - #ifdef HAVE_COMPUTED_GOTO - int lookup_sort_fun(const void *a, const void *b) - { -  return (int)(((ptrdiff_t)((struct op_2_f *)a)->opcode) - -  ((ptrdiff_t)((struct op_2_f *)b)->opcode)); - } - #endif /* HAVE_COMPUTED_GOTO */ +     - /* NOTE: Due to the implementation of computed goto, -  * interpreter.h may only be included once. -  */ - #if defined(PIKE_DEBUG) && !defined(HAVE_COMPUTED_GOTO) + #if defined(PIKE_DEBUG)   #define eval_instruction eval_instruction_with_debug - #include "interpreter_debug.h" -  + #include "interpreter.h"   #undef eval_instruction   #define eval_instruction eval_instruction_without_debug      #undef PIKE_DEBUG   #undef NDEBUG   #undef DO_IF_DEBUG   #define DO_IF_DEBUG(X)   #define print_return_value()   #include "interpreter.h"      #define PIKE_DEBUG   #define NDEBUG   #undef DO_IF_DEBUG   #define DO_IF_DEBUG(X) X   #undef print_return_value      #undef eval_instruction    - static INLINE int eval_instruction(unsigned char *pc) + static inline int eval_instruction(unsigned char *pc)   {    if(d_flag || Pike_interpreter.trace_level>2)    return eval_instruction_with_debug(pc);    else    return eval_instruction_without_debug(pc);   }       - #else /* !PIKE_DEBUG || HAVE_COMPUTED_GOTO */ + #else /* !PIKE_DEBUG */   #include "interpreter.h"   #endif         #endif /* PIKE_USE_MACHINE_CODE */      #undef REAL_PIKE_DEBUG   #undef DO_IF_REAL_DEBUG   #undef DO_IF_NOT_REAL_DEBUG       - static void do_trace_call(INT32 args, dynamic_buffer *old_buf) + ATTRIBUTE((noinline)) + static void do_trace_call(struct byte_buffer *b, INT32 args)   {    struct pike_string *filep = NULL; -  char *file, *s; +  char *file; +  const char *s;    INT_TYPE linep;    INT32 e;    ptrdiff_t len = 0;    -  my_strcat("("); +  buffer_add_str(b, "(");    for(e=0;e<args;e++)    { -  if(e) my_strcat(","); -  safe_describe_svalue(Pike_sp-args+e,0,0); +  if(e) buffer_add_str(b, ","); +  safe_describe_svalue(b, Pike_sp-args+e,0,0);    } -  my_strcat(")"); +  buffer_add_str(b, ")");    -  s=simple_free_buf(old_buf); -  if((size_t)strlen(s) > (size_t)TRACE_LEN) +  if(buffer_content_length(b) > TRACE_LEN)    { -  s[TRACE_LEN]=0; -  s[TRACE_LEN-1]='.'; -  s[TRACE_LEN-2]='.'; -  s[TRACE_LEN-3]='.'; +  buffer_remove(b, buffer_content_length(b) - TRACE_LEN); +  buffer_add_str(b, "...");    }       if(Pike_fp && Pike_fp->pc)    {    char *f;    filep = get_line(Pike_fp->pc,Pike_fp->context->prog,&linep);    if (filep->size_shift)    file = "...";    else {    file = filep->str; -  while((f = STRCHR(file, '/')) +  while((f = strchr(file, '/'))   #ifdef __NT__ -  || (f = STRCHR(file, '\\')) +  || (f = strchr(file, '\\'))   #endif /* __NT__ */    )    file=f+1;    len = filep->len - (file - filep->str);    }    }else{    linep=0;    file="-";    }    -  +  s = buffer_get_string(b); +     if (len < 30)    {    char buf[40];    if (linep) -  SNPRINTF(buf, sizeof (buf), "%s:%ld:", file, (long)linep); +  snprintf(buf, sizeof (buf), "%s:%ld:", file, (long)linep);    else -  SNPRINTF(buf, sizeof (buf), "%s:", file); +  snprintf(buf, sizeof (buf), "%s:", file);    fprintf(stderr, "- %-20s %s\n",buf,s);    } else if (linep) {    fprintf(stderr, "- %s:%ld: %s\n", file, (long)linep, s);    } else {    fprintf(stderr, "- %s: %s\n", file, s);    }       if (filep) {    free_string(filep);    } -  free(s); +  buffer_free(b);   }    -  + ATTRIBUTE((noinline)) + static void do_trace_function_call(const struct object *o, const struct identifier *function, INT32 args) { +  struct byte_buffer buffer = BUFFER_INIT(); +  char buf[50]; +  +  sprintf(buf, "%lx->", (long) PTR_TO_INT (o)); +  buffer_add_str(&buffer, buf); +  if (function->name->size_shift) +  buffer_add_str (&buffer, "[widestring function name]"); +  else +  buffer_add_str(&buffer, function->name->str); +  do_trace_call(&buffer, args); + } +  + ATTRIBUTE((noinline)) + static void do_trace_efun_call(const struct svalue *s, INT32 args) { +  struct byte_buffer buf = BUFFER_INIT(); +  if (s->u.efun->name->size_shift) +  buffer_add_str (&buf, "[widestring function name]"); +  else +  buffer_add_str (&buf, s->u.efun->name->str); +  do_trace_call(&buf, args); + } +  + ATTRIBUTE((noinline)) + static void do_trace_svalue_call(const struct svalue *s, INT32 args) { +  struct byte_buffer buf = BUFFER_INIT(); +  safe_describe_svalue(&buf, s,0,0); +  do_trace_call(&buf, args); + } +  +  + ATTRIBUTE((noinline))   static void do_trace_func_return (int got_retval, struct object *o, int fun)   { -  dynamic_buffer save_buf; -  init_buf (&save_buf); +  struct byte_buffer b = BUFFER_INIT();    if (o) {    if (o->prog) {    struct identifier *id = ID_FROM_INT (o->prog, fun);    char buf[50]; -  sprintf(buf, "%lx->", DO_NOT_WARN((long) PTR_TO_INT (o))); -  my_strcat(buf); +  sprintf(buf, "%lx->", (long) PTR_TO_INT (o)); +  buffer_add_str(&b, buf);    if (id->name->size_shift) -  my_strcat ("[widestring function name]"); +  buffer_add_str (&b, "[widestring function name]");    else -  my_strcat(id->name->str); -  my_strcat ("() "); +  buffer_add_str(&b, id->name->str); +  buffer_add_str (&b, "() ");    }    else -  my_strcat ("function in destructed object "); +  buffer_add_str (&b, "function in destructed object ");    } -  do_trace_return (got_retval, &save_buf); +  do_trace_return (&b, got_retval);   }    - static void do_trace_return (int got_retval, dynamic_buffer *old_buf) + #ifdef PIKE_DEBUG + ATTRIBUTE((noinline)) + static void do_trace_efun_return(const struct svalue *s, int got_retval) { +  struct byte_buffer buf = BUFFER_INIT(); +  if (s->u.efun->name->size_shift) +  buffer_add_str (&buf, "[widestring function name]"); +  else +  buffer_add_str (&buf, s->u.efun->name->str); +  buffer_add_str (&buf, "() "); +  do_trace_return (&buf, got_retval); + } + #endif +  + ATTRIBUTE((noinline)) + static void do_trace_return (struct byte_buffer *b, int got_retval)   {    struct pike_string *filep = NULL; -  char *file, *s; +  char *file; +  const char *s;    INT_TYPE linep;       if (got_retval) { -  my_strcat ("returns: "); -  safe_describe_svalue(Pike_sp-1,0,0); +  buffer_add_str (b, "returns: "); +  safe_describe_svalue(b, Pike_sp-1,0,0);    }    else -  my_strcat ("returns with no value"); +  buffer_add_str (b, "returns with no value");    -  s=simple_free_buf(old_buf); -  if((size_t)strlen(s) > (size_t)TRACE_LEN) +  if(buffer_content_length(b) > TRACE_LEN)    { -  s[TRACE_LEN]=0; -  s[TRACE_LEN-1]='.'; -  s[TRACE_LEN-2]='.'; -  s[TRACE_LEN-3]='.'; +  buffer_remove(b, buffer_content_length(b) - TRACE_LEN); +  buffer_add_str(b, "...");    }    -  +  s = buffer_get_string(b); +     if(Pike_fp && Pike_fp->pc)    {    char *f;    filep = get_line(Pike_fp->pc,Pike_fp->context->prog,&linep);    if (filep->size_shift)    file = "...";    else {    file = filep->str; -  while((f=STRCHR(file,'/'))) +  while((f=strchr(file,'/')))    file=f+1;    }    }else{    linep=0;    file="-";    }       {    char buf[40];    if (linep) -  SNPRINTF(buf, sizeof (buf), "%s:%ld:", file, (long)linep); +  snprintf(buf, sizeof (buf), "%s:%ld:", file, (long)linep);    else -  SNPRINTF(buf, sizeof (buf), "%s:", file); +  snprintf(buf, sizeof (buf), "%s:", file);    fprintf(stderr,"- %-20s %s\n",buf,s);    }       if (filep) {    free_string(filep);    } -  free(s); +  buffer_free(b);   }      static struct pike_frame_chunk {    struct pike_frame_chunk *next;   } *pike_frame_chunks;   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")); -  +  if (X->flags & PIKE_FRAME_SAVE_LOCALS) { +  free(X->save_locals_bitmask); +  X->flags &= ~PIKE_FRAME_SAVE_LOCALS; +  }    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 )    {    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*)); -  +  gc_init_marker(res);    res->refs=0;    add_ref(res); /* For DMALLOC... */    res->flags=0;    res->next=0;    res->scope=0; -  +  res->pc = NULL;    -  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 );
pike.git/src/interpret.c:2017:    {    res->next = &free_pike_frame[i];    res = res->next;    }    res->next = NULL;    num_pike_frames+=FRAMES_PER_CHUNK;    }    return alloc_pike_frame();   }    + void LOW_POP_PIKE_FRAME_slow_path(struct pike_frame *frame) + { +  debug_malloc_touch(frame); +  +  if (frame->flags & PIKE_FRAME_SAVE_LOCALS) { +  int num_new_locals = 0; +  int num_locals = frame->num_locals; +  int i; +  +  /* find the highest set bit */ +  for (i = num_locals - 1; i >= 0; i--) { +  unsigned INT16 bitmask = frame->save_locals_bitmask[i / 16]; +  +  if (bitmask & (1 << (i % 16))) { +  num_new_locals = i + 1; +  break; +  } +  } +  +  if (num_new_locals) +  { +  struct svalue *s = xcalloc(sizeof(struct svalue), num_new_locals); +  struct svalue *locals = frame->locals; +  unsigned INT16 bitmask = 0; +  +  for (i = 0; i < num_new_locals; i++) { +  unsigned INT16 bitmask = frame->save_locals_bitmask[i / 16]; +  +  if (bitmask & (1 << (i % 16))) { +  assign_svalue_no_free(s + i, locals + i); +  } + #ifdef PIKE_DEBUG +  else +  mark_free_svalue(s + i); + #endif +  } +  +  frame->locals = s; +  frame->flags |= PIKE_FRAME_MALLOCED_LOCALS; +  } else { +  frame->locals = NULL; +  } +  +  frame->flags &= ~PIKE_FRAME_SAVE_LOCALS; +  +  free(frame->save_locals_bitmask); +  +  frame->num_locals = num_new_locals; +  } else { +  frame->locals = NULL; +  } +  +  frame->next=0; + } +    void count_memory_in_pike_frames(size_t *num, size_t *size )   {    *num = num_pike_frames;    *size = num_pike_frame_chunks * (FRAME_CHUNK_SIZE*8);   }   #undef FRAMES_PER_CHUNK   #undef FRAME_CHUNK_SIZE    -  + #ifdef DO_PIKE_CLEANUP   static void free_all_pike_frame_blocks(void)   {    struct pike_frame_chunk *x = pike_frame_chunks, *n;    while( x )    {    n = x->next;    free(x);    x = n;    }    free_pike_frame = NULL;    pike_frame_chunks = NULL;    num_pike_frames=0;    num_pike_frame_chunks=0;   } -  + #endif      void really_free_pike_scope(struct pike_frame *scope)   {    if(scope->flags & PIKE_FRAME_MALLOCED_LOCALS)    {    free_mixed_svalues(scope->locals,scope->num_locals); -  free((char *)(scope->locals)); +  free(scope->locals);   #ifdef PIKE_DEBUG    scope->flags&=~PIKE_FRAME_MALLOCED_LOCALS;   #endif    }    really_free_pike_frame(scope);   }      void *lower_mega_apply( INT32 args, struct object *o, ptrdiff_t fun )   {    struct program *p;
pike.git/src/interpret.c:2077:       int type = (function->identifier_flags & (IDENTIFIER_TYPE_MASK|IDENTIFIER_ALIAS));    if( o->prog != pike_trampoline_program && function->func.offset != -1 )    {    switch( type )    {    case IDENTIFIER_CONSTANT:    constant = &context->prog->constants[function->func.const_info.offset].sval;    if( TYPEOF(*constant) != PIKE_T_PROGRAM )    break; +  /* FALLTHRU */    case IDENTIFIER_C_FUNCTION:    case IDENTIFIER_PIKE_FUNCTION:    if( !new_frame )    {    new_frame=alloc_pike_frame();    debug_malloc_touch(new_frame);    }   #ifdef PROFILING    new_frame->children_base = Pike_interpreter.accounted_time;    new_frame->start_time = get_cpu_time() - Pike_interpreter.unlocked_time;       /* This is mostly for profiling, but    * could also be used to find out the name of a function    * in a destructed object. -hubbe    *    * Since it not used for anything but profiling yet, I will    * put it here until someone needs it. -Hubbe    */    new_frame->ident = ref->identifier_offset; -  DO_IF_PROFILING_DEBUG({ -  fprintf(stderr, "%p{: Push at %" PRINT_CPU_TIME +  W_PROFILING_DEBUG("%p{: Push at %" PRINT_CPU_TIME    " %" PRINT_CPU_TIME "\n", -  Pike_interpreter.thread_state, new_frame->start_time, +  Pike_interpreter.thread_state, +  new_frame->start_time,    new_frame->children_base); -  }); +    #endif    new_frame->next = Pike_fp;    add_ref(new_frame->current_object = o);    add_ref(new_frame->current_program = p);    new_frame->context = context; -  new_frame->fun = DO_NOT_WARN((unsigned INT16)fun); -  new_frame->expendible = new_frame->locals = save_sp; +  new_frame->fun = (unsigned INT16)fun; +  new_frame->locals = save_sp;    new_frame->args = args; -  new_frame->save_sp = save_sp; +  new_frame->save_sp_offset = 0;      #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_FREE)    Pike_fatal("Pike code called within gc.\n");   #endif       Pike_fp = new_frame;    debug_malloc_touch(Pike_fp);   #ifdef PROFILING    function->num_calls++;
pike.git/src/interpret.c:2135:   #endif       if( !constant )    {    if (PIKE_FN_START_ENABLED())    {    /* DTrace enter probe    arg0: function name    arg1: object    */ -  dynamic_buffer save_buf; -  dynbuf_string obj_name; +  struct byte_buffer obj_name = BUFFER_INIT();    struct svalue obj_sval;    SET_SVAL(obj_sval, T_OBJECT, 0, object, o); -  init_buf(&save_buf); -  safe_describe_svalue(&obj_sval, 0, NULL); -  obj_name = complex_free_buf(&save_buf); +  safe_describe_svalue(&obj_name, &obj_sval, 0, NULL);    PIKE_FN_START(function->name->size_shift == 0 ?    function->name->str : "[widestring fn name]", -  obj_name.str); +  buffer_get_string(s)); +  buffer_free(&obj_name);    }    if(UNLIKELY(Pike_interpreter.trace_level))    { -  dynamic_buffer save_buf; -  char buf[50]; -  -  init_buf(&save_buf); -  sprintf(buf, "%lx->", DO_NOT_WARN((long) PTR_TO_INT (o))); -  my_strcat(buf); -  if (function->name->size_shift) -  my_strcat ("[widestring function name]"); -  else -  my_strcat(function->name->str); -  do_trace_call(args, &save_buf); +  do_trace_function_call(o, function, args);    } -  +  new_frame->current_storage = o->storage+context->storage_offset;    if( type == IDENTIFIER_C_FUNCTION )    {    new_frame->num_args = args;    new_frame->num_locals = args; -  new_frame->current_storage = o->storage+context->storage_offset; +     new_frame->pc = 0;   #ifndef PIKE_USE_MACHINE_CODE    FAST_CHECK_THREADS_ON_CALL();   #endif    (*function->func.c_fun)(args);       /* .. and below follows what is basically a copy of the    * low_return function...    */    if(save_sp+1 > Pike_sp)    {    push_int(0);    } else if(save_sp+1 < Pike_sp) {    stack_pop_n_elems_keep_top( Pike_sp-save_sp-1 );    }    if(UNLIKELY(Pike_interpreter.trace_level>1))    do_trace_func_return (1, o, fun);    goto pop;    } -  new_frame->save_mark_sp=new_frame->mark_sp_base=Pike_mark_sp; +  new_frame->save_mark_sp=Pike_mark_sp;    new_frame->pc = new_frame->context->prog->program + function->func.offset   #ifdef ENTRY_PROLOGUE_SIZE    + ENTRY_PROLOGUE_SIZE   #endif /* ENTRY_PROLOGUE_SIZE */    ;    return new_frame->pc;    }    else    {    struct object *tmp;
pike.git/src/interpret.c:2266:   #endif       switch(type)    {    case APPLY_STACK:    if(!args)    PIKE_ERROR("`()", "Too few arguments (apply stack).\n", Pike_sp, 0);    args--;    arg1=(void *)(Pike_sp-args-1);    +  /* FALLTHRU */ +     case APPLY_SVALUE:    case APPLY_SVALUE_STRICT:    apply_svalue:    {    struct svalue *s=(struct svalue *)arg1;    switch(TYPEOF(*s))    {    case T_INT:    if (!s->u.integer) {    PIKE_ERROR("0", "Attempt to call the NULL-value\n", Pike_sp, args);    } else {    Pike_error("Attempt to call the value %"PRINTPIKEINT"d\n",    s->u.integer);    } -  +  break;       case T_STRING:    if (s->u.string->len > 20) {    Pike_error("Attempt to call the string \"%20S\"...\n", s->u.string);    } else {    Pike_error("Attempt to call the string \"%S\"\n", s->u.string);    } -  +  break; +     case T_MAPPING:    Pike_error("Attempt to call a mapping\n"); -  +  break; +     default:    Pike_error("Call to non-function value type:%s.\n",    get_name_of_type(TYPEOF(*s))); -  +  break;       case T_FUNCTION:    if(SUBTYPEOF(*s) == FUNCTION_BUILTIN)    {   #ifdef PIKE_DEBUG    struct svalue *expected_stack = Pike_sp-args;   #endif    if(Pike_interpreter.trace_level>1)    { -  dynamic_buffer save_buf; -  init_buf(&save_buf); -  if (s->u.efun->name->size_shift) -  my_strcat ("[widestring function name]"); -  else -  my_strcat (s->u.efun->name->str); -  do_trace_call(args, &save_buf); +  do_trace_efun_call(s, args);    }    if (PIKE_FN_START_ENABLED()) {    /* DTrace enter probe    arg0: function name    arg1: object    */    PIKE_FN_START(s->u.efun->name->size_shift == 0 ?    s->u.efun->name->str : "[widestring fn name]",    "");    }
pike.git/src/interpret.c:2366:    scope=((struct pike_trampoline *)(o->storage))->frame;    o=scope->current_object;    }    goto apply_low;    }    break;       case T_ARRAY:    if(Pike_interpreter.trace_level)    { -  dynamic_buffer save_buf; -  init_buf(&save_buf); -  safe_describe_svalue(s,0,0); -  do_trace_call(args, &save_buf); +  do_trace_svalue_call(s, args);    }    if (PIKE_FN_START_ENABLED()) {    /* DTrace enter probe    arg0: function name    arg1: object    */    PIKE_FN_START("[array]", "");    }    apply_array(s->u.array, args, (type == APPLY_STACK));    break;
pike.git/src/interpret.c:2392:    if (args != 1) {    /* FIXME: Casts to object ought to propagate to apply program below. */    SIMPLE_WRONG_NUM_ARGS_ERROR("cast", 1);    }    o_cast(s->u.type, compile_type_to_runtime_type(s->u.type));    break;       case T_PROGRAM:    if(Pike_interpreter.trace_level)    { -  dynamic_buffer save_buf; -  init_buf(&save_buf); -  safe_describe_svalue(s,0,0); -  do_trace_call(args, &save_buf); +  do_trace_svalue_call(s, args);    }    if (PIKE_FN_START_ENABLED()) {    /* DTrace enter probe    arg0: function name    arg1: object    */ -  dynamic_buffer save_buf; -  dynbuf_string prog_name; -  init_buf(&save_buf); -  safe_describe_svalue(s,0,0); -  prog_name = complex_free_buf(&save_buf); -  PIKE_FN_START("[program]", prog_name.str); +  struct byte_buffer buf = BUFFER_INIT(); +  safe_describe_svalue(&buf, s,0,0); +  PIKE_FN_START("[program]", buffer_get_string(&buf)); +  buffer_free(&buf);    }    push_object(clone_object(s->u.program,args));    break;       case T_OBJECT:    /* FIXME: Object subtypes! */    o=s->u.object;    if(o->prog == pike_trampoline_program)    {    fun=((struct pike_trampoline *)(o->storage))->func;
pike.git/src/interpret.c:2513:    Pike_fatal("Stack error (also simple).\n"); \    ) \    \    Pike_mark_sp=Pike_fp->save_mark_sp; \    \    POP_PIKE_FRAME()         void low_return(void)   { -  struct svalue *save_sp = Pike_fp->save_sp+1; +  struct svalue *save_sp = frame_get_save_sp(Pike_fp)+1;    struct object *o = Pike_fp->current_object;    int fun = Pike_fp->fun;       if (PIKE_FN_DONE_ENABLED()) {    /* DTrace leave probe    arg0: function name    */    char *fn = "(unknown)";    if (o && o->prog) {    struct identifier *id = ID_FROM_INT(o->prog, fun);
pike.git/src/interpret.c:2565:    if(UNLIKELY(Pike_interpreter.trace_level>1))    do_trace_func_return (1, o, fun);      #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    free_object (o);   #endif   }      void low_return_pop(void)   { -  struct svalue *save_sp = Pike_fp->save_sp; +  struct svalue *save_sp = frame_get_save_sp(Pike_fp);   #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    /* See note above. */    struct object *o = Pike_fp->current_object;    add_ref (o);   #endif       if (PIKE_FN_DONE_ENABLED()) {    /* DTrace leave probe    arg0: function name    */
pike.git/src/interpret.c:2622: Inside #if defined(PIKE_DEBUG)
   {    while(rec->frame_pointer == current) rec=rec->previous;    /* FIXME: Wouldn't a simple return be ok? */    if(rec->frame_pointer == current->next)    Pike_fatal("You can't touch this!\n");    }    }   #endif    /* Save various fields from the previous frame.    */ -  current->save_sp=prev->save_sp; +  frame_set_save_sp(current, frame_get_save_sp(prev));    current->save_mark_sp=prev->save_mark_sp; -  current->flags = prev->flags; +  current->flags = prev->flags & PIKE_FRAME_RETURN_MASK;       /* Unlink the top frame temporarily. */    Pike_interpreter.frame_pointer=prev;      #ifdef PROFILING    {    /* We must update the profiling info of the previous frame    * to account for that the current frame has gone away.    */    cpu_time_t total_time =
pike.git/src/interpret.c:2810:    move_svalue (Pike_sp++, &throw_value);    mark_free_svalue (&throw_value);       if (get_master()) { /* May return NULL at odd times. */    ONERROR tmp;    SET_ONERROR(tmp,exit_on_error,"Error in handle_error in master object!");    APPLY_MASTER("handle_error", 1);    UNSET_ONERROR(tmp);    }    else { -  dynamic_buffer save_buf; -  char *s; +  struct byte_buffer buf = BUFFER_INIT();    fprintf (stderr, "There's no master to handle the error. Dumping it raw:\n"); -  init_buf(&save_buf); -  safe_describe_svalue (Pike_sp - 1, 0, 0); -  s=simple_free_buf(&save_buf); -  fprintf(stderr,"%s\n",s); -  free(s); +  safe_describe_svalue (&buf, Pike_sp - 1, 0, 0); +  fprintf(stderr,"%s\n",buffer_get_string(&buf)); +  buffer_free(&buf);    if (TYPEOF(Pike_sp[-1]) == PIKE_T_OBJECT && Pike_sp[-1].u.object->prog) {    int fun = find_identifier("backtrace", Pike_sp[-1].u.object->prog);    if (fun != -1) {    fprintf(stderr, "Attempting to extract the backtrace.\n");    safe_apply_low2(Pike_sp[-1].u.object, fun, 0, 0); -  init_buf(&save_buf); -  safe_describe_svalue(Pike_sp - 1, 0, 0); +  safe_describe_svalue(&buf, Pike_sp - 1, 0, 0);    pop_stack(); -  s=simple_free_buf(&save_buf); -  fprintf(stderr,"%s\n",s); -  free(s); +  fprintf(stderr,"%s\n",buffer_get_string(&buf)); +  buffer_free(&buf);    }    }    }       pop_stack();    Pike_interpreter.svalue_stack_margin = SVALUE_STACK_MARGIN;    Pike_interpreter.c_stack_margin = C_STACK_MARGIN;    Pike_interpreter.trace_level = old_t_flag;    }   
pike.git/src/interpret.c:2896:    fun = prog->num_identifier_references;    add_to_identifier_references(dummy_ref);    }       /* FIXME: Is this up-to-date with mega_apply? */    new_frame->next = Pike_fp;    add_ref(new_frame->current_object = o);    add_ref(new_frame->current_program = prog);    new_frame->context = prog->inherits;    new_frame->locals = Pike_sp; -  new_frame->expendible=new_frame->locals; +     new_frame->args = 0;    new_frame->num_args=0;    new_frame->num_locals=0;    new_frame->fun = fun;    new_frame->pc = 0;    new_frame->current_storage=o->storage;      #ifdef PIKE_DEBUG    if (Pike_fp && (new_frame->locals < Pike_fp->locals)) { -  fatal("New locals below old locals: %p < %p\n", +  Pike_fatal("New locals below old locals: %p < %p\n",    new_frame->locals, Pike_fp->locals);    }   #endif /* PIKE_DEBUG */       Pike_fp = new_frame;       saved_jmpbuf = Pike_interpreter.catching_eval_jmpbuf;    Pike_interpreter.catching_eval_jmpbuf = NULL;       if(SETJMP(tmp))    {    ret=1;    }else{    int tmp; -  new_frame->mark_sp_base=new_frame->save_mark_sp=Pike_mark_sp; +  new_frame->save_mark_sp=Pike_mark_sp;    tmp=eval_instruction(prog->program + offset);    Pike_mark_sp=new_frame->save_mark_sp;      #ifdef PIKE_DEBUG    if (tmp != -1)    Pike_fatal ("Unexpected return value from eval_instruction: %d\n", tmp);    if(Pike_sp<Pike_interpreter.evaluator_stack)    Pike_fatal("Stack error (simple).\n");   #endif    ret=0;
pike.git/src/interpret.c:3051:    struct object *master_obj = master();    if ((i = find_identifier(fun, master_obj->prog)) != -1)    safe_apply_low2(master_obj, i, args, fun);    else {    pop_n_elems(args);    push_undefined();    }    }   }    + PMOD_EXPORT void push_text( const char *x ) + { +  struct pike_string *s = make_shared_string(x); +  struct svalue *_sp_ = Pike_sp++; +  SET_SVAL_SUBTYPE(*_sp_, 0); +  _sp_->u.string=s; +  debug_malloc_touch(_sp_->u.string); +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); + } +  + PMOD_EXPORT void push_static_text( const char *x ) + { +  struct pike_string *s = make_shared_static_string(x, strlen(x), eightbit); +  struct svalue *_sp_ = Pike_sp++; +  SET_SVAL_SUBTYPE(*_sp_, 0); +  _sp_->u.string=s; +  debug_malloc_touch(_sp_->u.string); +  SET_SVAL_TYPE(*_sp_, PIKE_T_STRING); + } +    /* NOTE: Returns 1 if result on stack, 0 otherwise. */   PMOD_EXPORT int safe_apply_handler(const char *fun,    struct object *handler,    struct object *compat,    INT32 args,    TYPE_FIELD rettypes)   {    JMP_BUF recovery;    int ret;   
pike.git/src/interpret.c:3099:    UNSETJMP(recovery);       STACK_LEVEL_DONE(ret);       return ret;   }      PMOD_EXPORT void apply_lfun(struct object *o, int lfun, int args)   {    int fun; - #ifdef PIKE_DEBUG -  if(lfun < 0 || lfun >= NUM_LFUNS) -  Pike_fatal("Apply lfun on illegal value!\n"); - #endif +     if(!o->prog)    PIKE_ERROR("destructed object", "Apply on destructed object.\n",    Pike_sp, args);       if ((fun = (int)FIND_LFUN(o->prog, lfun)) < 0)    Pike_error("Calling undefined lfun::%s.\n", lfun_names[lfun]);       apply_low(o, fun, args);   }   
pike.git/src/interpret.c:3194:       find_external_context(&loc, depth);       apply_low(loc.o, fun + loc.inherit->identifier_level, args);    } else {    PIKE_ERROR("destructed object", "Apply on parent of destructed object.\n",    Pike_sp, args);    }   }    + /* mode=1 : Exception on lookup and on execution +  * mode=2 : Exception on lookup but not execution +  * mode=3 : No exceptions +  */ + PMOD_EXPORT void apply_master(const char* fun, INT32 args, int mode) + { +  static int id_=-1; +  struct object *master_ob=master(); +  if(master_ob->prog->id != 0) +  id_=find_identifier(fun, master_ob->prog); +  +  if (id_ >= 0) { +  if( mode==1 ) +  apply_low(master_ob, id_, args); +  else +  safe_apply_low2(master_ob, id_, args, fun); +  } else { +  if( mode==3 ) +  { +  pop_n_elems(args); +  push_undefined(); +  } +  else +  Pike_error("Cannot call undefined function \"%s\" in master.\n", fun); +  } + } +    #ifdef PIKE_DEBUG   void slow_check_stack(void)   {    struct svalue *s,**m;    struct pike_frame *f;       debug_check_stack();       if(Pike_sp > &(Pike_interpreter.evaluator_stack[Pike_stack_size]))    Pike_fatal("Svalue stack overflow. "    "(%ld entries on stack, stack_size is %ld entries)\n", -  PTRDIFF_T_TO_LONG(Pike_sp - Pike_interpreter.evaluator_stack), -  PTRDIFF_T_TO_LONG(Pike_stack_size)); +  (long)(Pike_sp - Pike_interpreter.evaluator_stack), +  (long)Pike_stack_size);       if(Pike_mark_sp > &(Pike_interpreter.mark_stack[Pike_stack_size]))    Pike_fatal("Mark stack overflow.\n");       if(Pike_mark_sp < Pike_interpreter.mark_stack)    Pike_fatal("Mark stack underflow.\n");       for(s=Pike_interpreter.evaluator_stack;s<Pike_sp;s++) {    /* NOTE: Freed svalues are allowed on the stack. */    if (TYPEOF(*s) != PIKE_T_FREE) check_svalue(s);
pike.git/src/interpret.c:3244: Inside #if defined(PIKE_DEBUG)
   {    if(f->locals < Pike_interpreter.evaluator_stack ||    f->locals > &(Pike_interpreter.evaluator_stack[Pike_stack_size]))    Pike_fatal("Local variable pointer points to FinspĂ„ng.\n");       if(f->args < 0 || f->args > Pike_stack_size)    Pike_fatal("FEL FEL FEL! HELP!! (corrupted pike_frame)\n");    }    }   } + #endif    -  +    static const char *safe_idname_from_int(struct program *prog, int func)   {    /* ID_FROM_INT with a thick layer of checks. */    struct reference *ref;    struct inherit *inher;    struct identifier *id;    if (!prog)    return "<null program *>";    if (func < 0 || func >= prog->num_identifier_references)    return "<offset outside prog->identifier_references>";
pike.git/src/interpret.c:3282: Inside #if defined(PIKE_DEBUG)
   if (!id->name)    return "<null identifier->name>";    if (id->name->size_shift)    return "<wide identifier->name->str>";    /* FIXME: Convert wide string identifiers to narrow strings? */    return id->name->str;   }      /*: Prints the Pike backtrace for the interpreter context in the given    *: thread to stderr, without messing in the internals (doesn't even -  *: use dynamic_buffer). +  *: use struct byte_buffer).    *:    *: This function is intended only for convenient use inside a    *: debugger session; it can't be used from inside the code.    */   void gdb_backtrace (   #ifdef PIKE_THREADS    THREAD_T thread_id   #endif   )   {
pike.git/src/interpret.c:3336:    fputs (safe_idname_from_int(f->current_program, f->fun), stderr);    fputc ('(', stderr);    }    else    fputs ("unknown function(", stderr);       if(!f->locals)    {    args=0;    }else{ -  args=f->num_args; -  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); +  ptrdiff_t tmp; +  +  if(of) { +  tmp = of->locals - f->locals; +  } else { + #ifdef PIKE_THREADS +  tmp = ts->state.stack_pointer - f->locals; + #else +  tmp = f->num_args; /* FIXME */ + #endif    } -  +  args = (INT32)tmp; +  args = MAXIMUM(MINIMUM(args, f->num_args),0); +  }       for (i = 0; i < args; i++) {    struct svalue *arg = f->locals + i;       switch (TYPEOF(*arg)) {    case T_INT:    fprintf (stderr, "%ld", (long) arg->u.integer);    break;       case T_TYPE:
pike.git/src/interpret.c:3499: Inside #if defined(PIKE_THREADS)
   struct thread_state *ts = 0;    while ((i = gdb_next_thread_state (i, &ts)), ts) {    fprintf (stderr, "\nTHREAD_ID %p (swapped %s):\n",    (void *)(ptrdiff_t)ts->id, ts->swapped ? "out" : "in");    gdb_backtrace (ts->id);    }   #else    gdb_backtrace();   #endif   } - #endif +       PMOD_EXPORT void custom_check_stack(ptrdiff_t amount, const char *fmt, ...)   {    if (low_stack_check(amount)) {    va_list args;    va_start(args, fmt);    va_error(fmt, args);    }   }   
pike.git/src/interpret.c:3528: Inside #if defined(USE_MMAP_FOR_STACK)
   }    if(!interpreter->mark_stack_malloced)    {    munmap((char *)interpreter->mark_stack,    Pike_stack_size*sizeof(struct svalue *));    interpreter->mark_stack = 0;    }   #endif       if(interpreter->evaluator_stack) -  free((char *)interpreter->evaluator_stack); +  free(interpreter->evaluator_stack);    if(interpreter->mark_stack) -  free((char *)interpreter->mark_stack); +  free(interpreter->mark_stack);       interpreter->mark_stack = 0;    interpreter->evaluator_stack = 0;    interpreter->mark_stack_malloced = 0;    interpreter->evaluator_stack_malloced = 0;       interpreter->stack_pointer = 0;    interpreter->mark_stack_pointer = 0;    interpreter->frame_pointer = 0;   }