pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:473:      PMOD_EXPORT DECLSPEC(noreturn) void debug_va_fatal(const char *fmt, va_list args) ATTRIBUTE((noreturn))   {    static int in_fatal = 0;       /* fprintf(stderr, "Raw error: %s\n", fmt); */       /* Prevent double fatal. */    if (in_fatal)    { -  if (fmt) (void)VFPRINTF(stderr, fmt, args); +  if (fmt) (void)vfprintf(stderr, fmt, args);    do_abort();    }       in_fatal = 1;   #ifdef PIKE_DEBUG    if (d_flag) {   #ifdef HAVE_VA_COPY    if (fmt) {    va_list a;    va_copy (a, args); -  (void)VFPRINTF(stderr, fmt, a); +  (void)vfprintf(stderr, fmt, a);    va_end (a);    }   #endif    dump_backlog();    }   #endif    -  if (fmt) (void)VFPRINTF(stderr, fmt, args); +  if (fmt) (void)vfprintf(stderr, fmt, args);       if(Pike_in_gc)    fprintf(stderr,"Pike was in GC stage %d when this fatal occurred.\n",Pike_in_gc);    Pike_in_gc = GC_PASS_DISABLED;       d_flag=Pike_interpreter.trace_level=0;       if(Pike_sp && Pike_interpreter.evaluator_stack &&    master_object && master_object->prog)    {    JMP_BUF jmp;    struct callback_list saved_eval_cbs = evaluator_callbacks;    /* Simulate threads_disabled to avoid thread switches or any other    * evaluator stuff while we let the master describe the backtrace    * below. Doing it the naughty way without going through    * init_threads_disable etc to avoid hanging on runaway locks. */   #ifdef PIKE_THREADS    threads_disabled++;   #endif -  MEMSET (&evaluator_callbacks, 0, sizeof (evaluator_callbacks)); +  memset (&evaluator_callbacks, 0, sizeof (evaluator_callbacks));    if (SETJMP (jmp))    fprintf(stderr,"Got exception when trying to describe backtrace.\n");    else {    jmp.severity = THROW_EXIT; /* Don't want normal exit code to run here. */    push_error("Backtrace at time of fatal:\n");    APPLY_MASTER("describe_backtrace",1);    if(TYPEOF(Pike_sp[-1]) == PIKE_T_STRING)    write_to_stderr(Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len);    }    UNSETJMP (jmp);
pike.git/src/error.c:618:    *!    *! Cast operator.    *!    *! @note    *! The only supported type to cast to is @expr{"array"@}, which    *! generates an old-style error @expr{({@[message](),    *! @[backtrace]()})@}.    */   static void f_error_cast(INT32 args)   { -  if(Pike_sp[-1].u.string == literal_array_string) +  if(Pike_sp[-args].u.string == literal_array_string)    {    pop_stack();    apply_current (generic_err_message_fun, 0);    apply_current (generic_err_backtrace_fun, 0);    f_aggregate(2);    }    else    {    pop_stack();    push_undefined();
pike.git/src/error.c:653:    *!    *! @note    *! The error message is always terminated with a newline.    *!    *! @seealso    *! @[backtrace()]    */   static void f_error_index(INT32 args)   {    INT_TYPE ind; -  get_all_args("error->`[]",args,"%i",&ind); +  get_all_args("`[]",args,"%i",&ind);       switch(ind)    {    case 0:    pop_n_elems(args);    apply_current (generic_err_message_fun, 0);    break;    case 1:    pop_n_elems(args);    apply_current (generic_err_backtrace_fun, 0);    break;    default: -  index_error("error->`[]", Pike_sp-args, args, NULL, Pike_sp-args, +  index_error("`[]", Pike_sp-args, args, NULL, Pike_sp-args,    "Index %"PRINTPIKEINT"d is out of range 0..1.\n", ind);    break;    }   }      static void f_error__sizeof(INT32 args)   {    pop_n_elems(args);    push_int(2);   }