pike.git / src / error.c

version» Context lines:

pike.git/src/error.c:945:    free_svalue(& throw_value);    SET_SVAL(throw_value, PIKE_T_OBJECT, 0, object, o);    throw_severity = THROW_ERROR;    in_error=0;       dmalloc_touch_svalue(& throw_value);       pike_throw(); /* Hope someone is catching, or we will be out of balls. */   }    + static const char* get_fname(const char *fname) + { +  if (fname) return fname; +  return (Pike_fp->context->prog->identifiers + Pike_fp->fun)->name->str; + }      /* 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,
pike.git/src/error.c:999:      /* coverity[+kill] */   PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(    const char *func, int args,    int which_argument,    const char *expected_type,    struct svalue *got_value,    const char *desc, ...) ATTRIBUTE((noreturn))   {    const struct svalue *base_sp = args>=0 ? Pike_sp-args : NULL; +  func = get_fname(func);    INIT_ERROR(bad_argument);    ERROR_COPY(bad_argument, which_argument);    if (expected_type)    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);       ERROR_DONE();