pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:56:   PMOD_EXPORT const char msg_out_of_mem_2[] =    "Out of memory - failed to allocate %"PRINTSIZET"u bytes.\n";   PMOD_EXPORT const char msg_div_by_zero[] =    "Division by zero.\n";      /*    * Recoveries handling.    */      #ifdef PIKE_DEBUG - /* struct mapping *recovery_lookup = NULL; */ +       PMOD_EXPORT void check_recovery_context(void)   {    char foo;   #define TESTILITEST ((((char *)Pike_interpreter.recoveries)-((char *)&foo))*STACK_DIRECTION)    if(Pike_interpreter.recoveries &&    Pike_interpreter.recoveries->on_stack &&    TESTILITEST > 0) {    fprintf(stderr, "Recoveries is out biking (Pike_interpreter.recoveries=%p, Pike_sp=%p, %ld)!\n",    Pike_interpreter.recoveries, &foo,    (long)TESTILITEST);    fprintf(stderr, "Last recovery was added at %s:%d\n",    Pike_interpreter.recoveries->file,    Pike_interpreter.recoveries->line); -  push_int((ptrdiff_t)Pike_interpreter.recoveries); - /* if ((s = low_mapping_lookup(recovery_lookup, Pike_sp-1))) { */ - /* fprintf(stderr, "Try also looking at %s.\n", (char*)s->u.integer); */ - /* } */ -  pop_stack(); +     Pike_fatal("Recoveries is out biking (Pike_interpreter.recoveries=%p, C sp=%p, %ld)!\n",    Pike_interpreter.recoveries, &foo,    (long)TESTILITEST);    }       /* Add more stuff here when required */   }   #endif      /*! @decl void _gdb_breakpoint()
pike.git/src/error.c:111:    r->on_stack = on_stack;   #endif    r->frame_pointer=Pike_fp;    r->stack_pointer=Pike_sp - stack_pop_levels - Pike_interpreter.evaluator_stack;    r->mark_sp=Pike_mark_sp - Pike_interpreter.mark_stack;    r->previous=Pike_interpreter.recoveries;    r->onerror=0;    r->severity=THROW_ERROR;    Pike_interpreter.recoveries=r;    check_recovery_context(); - #ifdef PIKE_DEBUG - /* if (recovery_lookup && Pike_sp) { */ - /* push_int((ptrdiff_t)r); */ - /* push_int((ptrdiff_t)location); */ - /* mapping_insert(recovery_lookup, Pike_sp-2, Pike_sp-1); */ - /* pop_n_elems(2); */ - /* } */ - #endif +     return r;   }      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void pike_throw(void) ATTRIBUTE((noreturn))   {   #ifdef TRACE_UNFINISHED_TYPE_FIELDS    accept_unfinished_type_fields++;   #endif   
pike.git/src/error.c:1105:   }   #endif      void init_error(void)   {   #define ERR_SETUP   #include "errors.h"      #ifdef PIKE_DEBUG    dmalloc_accept_leak(add_gc_callback(gc_check_throw_value,0,0)); -  - /* recovery_lookup = allocate_mapping(100); */ +    #endif   }      void cleanup_error(void)   { - #ifdef PIKE_DEBUG - /* free_mapping(recovery_lookup); */ - #endif +    #define ERR_CLEANUP   #include "errors.h"   }