From: Philipp Stephani Date: Fri, 21 Sep 2018 19:56:25 +0000 (+0200) Subject: Use new function overflow_error in a few places X-Git-Tag: emacs-27.0.90~4392 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ee3be3fdfa96d7d1a0740c8145a26d758c12a711;p=emacs.git 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. --- diff --git a/src/emacs-module.c b/src/emacs-module.c index 6155535f869..1ecba8603ff 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c @@ -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)); } diff --git a/src/json.c b/src/json.c index 8b365e3795c..17cc0965b12 100644 --- a/src/json.c +++ b/src/json.c @@ -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);