emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master ee3be3f: Use new function overflow_error in a few p


From: Philipp Stephani
Subject: [Emacs-diffs] master ee3be3f: Use new function overflow_error in a few places
Date: Fri, 21 Sep 2018 15:57:10 -0400 (EDT)

branch: master
commit ee3be3fdfa96d7d1a0740c8145a26d758c12a711
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    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.
---
 src/emacs-module.c | 8 ++++----
 src/json.c         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index 6155535..1ecba86 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 8b365e3..17cc096 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]