pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:235:   {    push_text(description);    f_backtrace(0);    f_aggregate(2);   }      PMOD_EXPORT struct svalue throw_value = SVALUE_INIT_FREE;   PMOD_EXPORT int throw_severity;   static const char *in_error;    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void low_error(const char *buf) ATTRIBUTE((noreturn))   {    push_error(buf);    free_svalue(& throw_value);    move_svalue (&throw_value, --Pike_sp);    throw_severity = THROW_ERROR;    in_error=0;    pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }      PMOD_EXPORT void va_make_error (const char *fmt, va_list args)   {    struct string_builder s;    init_string_builder(&s, 0);    string_builder_vsprintf(&s, fmt, args);    push_string(finish_string_builder(&s));    f_backtrace(0);    f_aggregate(2);   }    -  + /* coverity[+kill] */   PMOD_EXPORT void DECLSPEC(noreturn) va_error(const char *fmt, va_list args)    ATTRIBUTE((noreturn))   {    SWAP_IN_THREAD_IF_REQUIRED();    if(in_error)    {    const char *tmp=in_error;    in_error = NULL;    Pike_fatal("Recursive Pike_error() calls, "    "original error: %s, new error: %s", tmp, fmt);
pike.git/src/error.c:310:      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void Pike_error(const char *fmt,...) ATTRIBUTE((noreturn))   {    va_list args;    va_start(args,fmt);    va_error(fmt,args);    va_end(args);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name,    const char *text,    struct svalue *oldsp,    INT32 args,    const char *file,    int line) ATTRIBUTE((noreturn))   {    int i;       ASSERT_THREAD_SWAPPED_IN();
pike.git/src/error.c:392:    free_svalue(&throw_value);    move_svalue (&throw_value, --Pike_sp);    throw_severity=THROW_ERROR;       in_error=0;    pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }      static int inhibit_errors = 0;    + /* coverity[+kill] */   PMOD_EXPORT void exit_on_error(const void *msg)   {    ONERROR tmp;    SET_ONERROR(tmp,fatal_on_error,"Fatal in exit_on_error!");    d_flag=0;    Pike_interpreter.trace_level = 0;       if (inhibit_errors)    fprintf (stderr, "Got recursive error in exit_on_error: %s\n", (char *) msg);   
pike.git/src/error.c:465: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    if (d_flag) {    fprintf(stderr,"%s\n",(char *)msg);    dump_backlog();    }   #endif    fprintf(stderr,"%s\n",(char *)msg);    do_abort();   }    + /* coverity[+kill] */   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);
pike.git/src/error.c:891:    * o A backtrace is assigned to error_backtrace.    *    * o If func is specified, a frame is constructed for at the end of    * backtrace using it as function name and base_sp[0..args-1] as    * arguments.    *    * o If fmt is specified, an error message is created from it and    * fmt_args using string_builder_vsprintf. (fmt_args is passed as a    * va_list pointer to be able to pass NULL if fmt is NULL.)    */ + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void generic_error_va(    struct object *o, const char *func, const struct svalue *base_sp, int args,    const char *fmt, va_list *fmt_args)   {    struct generic_error_struct *err = get_storage (o, generic_error_program);      #ifdef PIKE_DEBUG    if (!err)    Pike_fatal ("Got an object which doesn't inherit generic_error_program.\n");   #endif
pike.git/src/error.c:966:    pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }         /* Throw a preallocated error object.    *    * NOTE: The object MUST NOT have been cloned by a plain low_clone()!    * At least fast_clone_object() MUST have been used, or the object    * data must have been properly initialized in some other way!    */ + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void throw_error_object(    struct object *o,    const char *func,    struct svalue *base_sp, int args,    const char *desc, ...) ATTRIBUTE((noreturn))   {    va_list foo;    va_start(foo,desc);    ASSERT_THREAD_SWAPPED_IN();    DWERROR((stderr, "%s(): Throwing an error object\n", func));    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void generic_error(    const char *func,    struct svalue *base_sp, int args,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(generic);    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void index_error(    const char *func,    struct svalue *base_sp, int args,    struct svalue *value,    struct svalue *index,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(index);    ERROR_COPY_SVALUE(index, value);    ERROR_COPY_SVALUE(index, index);    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func,    struct svalue *base_sp, int args,    int which_argument,    const char *expected_type,    struct svalue *got_value,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(bad_argument);    ERROR_COPY(bad_argument, which_argument);
pike.git/src/error.c:1022:    ERROR_STRUCT(bad_argument,o)->expected_type =    make_shared_string(expected_type);    else    ERROR_STRUCT(bad_argument,o)->expected_type = NULL;    ERROR_COPY_SVALUE(bad_argument, got_value);    DWERROR((stderr, "%s():Bad arg %d (expected %s)\n",    func, which_argument, expected_type));    ERROR_DONE(generic);   }    + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void math_error(    const char *func,    struct svalue *base_sp, int args,    struct svalue *number,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(math);    if(number)    {    ERROR_COPY_SVALUE(math, number);    }else{    SET_SVAL(ERROR_STRUCT(math,o)->number, PIKE_T_INT, NUMBER_UNDEFINED,    integer, 0);    }    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void resource_error(    const char *func,    struct svalue *base_sp, int args,    const char *resource_type,    size_t howmuch_,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INT_TYPE howmuch = DO_NOT_WARN((INT_TYPE)howmuch_);    INIT_ERROR(resource);    ERROR_COPY(resource, howmuch);    ERROR_STRUCT(resource,o)->resource_type=make_shared_string(resource_type);    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void permission_error(    const char *func,    struct svalue *base_sp, int args,    const char *permission_type,    const char *desc, ...) ATTRIBUTE((noreturn))   {    INIT_ERROR(permission);    ERROR_STRUCT(permission,o)->permission_type=    make_shared_string(permission_type);    ERROR_DONE(generic);   }    -  + /* coverity[+kill] */   PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expected)   {    if(expected>args)    {    bad_arg_error (name, Pike_sp-args, args, expected, NULL, NULL,    "Too few arguments to %s(). Expected at least %d (got %d).\n",    name, expected, args);    }else {    bad_arg_error (name, Pike_sp-args, args, expected, NULL, NULL,    "Too many arguments to %s(). Expected at most %d (got %d).\n",