pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:5:   \*/   #include "global.h"   #include "macros.h"   #include "error.h"   #include "interpret.h"   #include "stralloc.h"   #include "builtin_functions.h"   #include "array.h"   #include "object.h"    + #undef ATTRIBUTE + #define ATTRIBUTE(X) +    char *automatic_fatal, *exit_on_error;   JMP_BUF *recoveries=0;   ONERROR *onerror_stack=0;    - my_jmp_buf *init_recovery(JMP_BUF *r) + JMP_BUF *init_recovery(JMP_BUF *r)   {    r->fp=fp;    r->sp=sp-evaluator_stack;    r->mark_sp=mark_sp - mark_stack;    r->previous=recoveries;    r->onerror=onerror_stack;    recoveries=r; -  return & ( r->recovery ); +  return r;   }    - void throw() + void throw() ATTRIBUTE((noreturn))   {    if(!recoveries)    fatal("No error recovery context.\n");      #ifdef DEBUG    if(sp - evaluator_stack < recoveries->sp)    fatal("Error in error.\n");   #endif       while(fp != recoveries->fp)
pike.git/src/error.c:60:   #endif    (*onerror_stack->func)(onerror_stack->arg);    onerror_stack=onerror_stack->previous;    }       longjmp(recoveries->recovery,1);   }      struct svalue throw_value = { T_INT };    - void va_error(char *fmt, va_list args) + void va_error(char *fmt, va_list args) ATTRIBUTE((noreturn))   {    char buf[2000];    static char *in_error;    if(in_error)    {    char *tmp=in_error;    in_error=0;    fatal("Recursive error() calls, original error: %s",tmp);    }   
pike.git/src/error.c:108:    f_backtrace(0);    f_aggregate(2);    free_svalue(& throw_value);    sp--;    throw_value = *sp;       in_error=0;    throw(); /* Hope someone is catching, or we will be out of balls. */   }    - void error(char *fmt,...) + void error(char *fmt,...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;    va_start(args,fmt);    va_error(fmt,args);    va_end(args);   }       - void fatal(char *fmt, ...) + void fatal(char *fmt, ...) ATTRIBUTE((noreturn,format (printf, 1, 2)))   {    va_list args;    static int in_fatal = 0;       va_start(args,fmt);    /* Prevent double fatal. */    if (in_fatal)    {    (void)VFPRINTF(stderr, fmt, args);    abort();