Use new function overflow_error in a few places

* src/emacs-module.c (module_make_global_ref, module_funcall)
(module_make_string, Fmodule_load):
* src/json.c (json_to_lisp): Use overflow_error.
This commit is contained in:
Philipp Stephani 2018-09-21 21:56:25 +02:00
parent 9f10e1a0ee
commit ee3be3fdfa
2 changed files with 6 additions and 6 deletions

View file

@ -304,7 +304,7 @@ module_make_global_ref (emacs_env *env, emacs_value ref)
Lisp_Object value = HASH_VALUE (h, i);
EMACS_INT refcount = XFIXNAT (value) + 1;
if (MOST_POSITIVE_FIXNUM < refcount)
xsignal0 (Qoverflow_error);
overflow_error ();
value = make_fixed_natnum (refcount);
set_hash_value_slot (h, i, value);
}
@ -475,7 +475,7 @@ module_funcall (emacs_env *env, emacs_value fun, ptrdiff_t nargs,
USE_SAFE_ALLOCA;
ptrdiff_t nargs1;
if (INT_ADD_WRAPV (nargs, 1, &nargs1))
xsignal0 (Qoverflow_error);
overflow_error ();
SAFE_ALLOCA_LISP (newargs, nargs1);
newargs[0] = value_to_lisp (fun);
for (ptrdiff_t i = 0; i < nargs; i++)
@ -583,7 +583,7 @@ module_make_string (emacs_env *env, const char *str, ptrdiff_t length)
{
MODULE_FUNCTION_BEGIN (module_nil);
if (! (0 <= length && length <= STRING_BYTES_BOUND))
xsignal0 (Qoverflow_error);
overflow_error ();
/* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated,
but we shouldn't require that. */
AUTO_STRING_WITH_LEN (lstr, str, length);
@ -749,7 +749,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0,
if (r != 0)
{
if (FIXNUM_OVERFLOW_P (r))
xsignal0 (Qoverflow_error);
overflow_error ();
xsignal2 (Qmodule_init_failed, file, make_fixnum (r));
}

View file

@ -740,7 +740,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
xsignal0 (Qjson_object_too_deep);
size_t size = json_array_size (json);
if (FIXNUM_OVERFLOW_P (size))
xsignal0 (Qoverflow_error);
overflow_error ();
Lisp_Object result = Fmake_vector (make_fixed_natnum (size), Qunbound);
for (ptrdiff_t i = 0; i < size; ++i)
ASET (result, i,
@ -759,7 +759,7 @@ json_to_lisp (json_t *json, struct json_configuration *conf)
{
size_t size = json_object_size (json);
if (FIXNUM_OVERFLOW_P (size))
xsignal0 (Qoverflow_error);
overflow_error ();
result = CALLN (Fmake_hash_table, QCtest, Qequal, QCsize,
make_fixed_natnum (size));
struct Lisp_Hash_Table *h = XHASH_TABLE (result);