aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs-module.c
diff options
context:
space:
mode:
authorPhilipp Stephani2018-09-21 21:56:25 +0200
committerPhilipp Stephani2018-09-21 21:56:56 +0200
commitee3be3fdfa96d7d1a0740c8145a26d758c12a711 (patch)
tree57fde5b97151c85fb75fc67ce612493e7613d800 /src/emacs-module.c
parent9f10e1a0eef0dd5572a34a76617d50df0e3dd357 (diff)
downloademacs-ee3be3fdfa96d7d1a0740c8145a26d758c12a711.tar.gz
emacs-ee3be3fdfa96d7d1a0740c8145a26d758c12a711.zip
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.
Diffstat (limited to 'src/emacs-module.c')
-rw-r--r--src/emacs-module.c8
1 files changed, 4 insertions, 4 deletions
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)
304 Lisp_Object value = HASH_VALUE (h, i); 304 Lisp_Object value = HASH_VALUE (h, i);
305 EMACS_INT refcount = XFIXNAT (value) + 1; 305 EMACS_INT refcount = XFIXNAT (value) + 1;
306 if (MOST_POSITIVE_FIXNUM < refcount) 306 if (MOST_POSITIVE_FIXNUM < refcount)
307 xsignal0 (Qoverflow_error); 307 overflow_error ();
308 value = make_fixed_natnum (refcount); 308 value = make_fixed_natnum (refcount);
309 set_hash_value_slot (h, i, value); 309 set_hash_value_slot (h, i, value);
310 } 310 }
@@ -475,7 +475,7 @@ module_funcall (emacs_env *env, emacs_value fun, ptrdiff_t nargs,
475 USE_SAFE_ALLOCA; 475 USE_SAFE_ALLOCA;
476 ptrdiff_t nargs1; 476 ptrdiff_t nargs1;
477 if (INT_ADD_WRAPV (nargs, 1, &nargs1)) 477 if (INT_ADD_WRAPV (nargs, 1, &nargs1))
478 xsignal0 (Qoverflow_error); 478 overflow_error ();
479 SAFE_ALLOCA_LISP (newargs, nargs1); 479 SAFE_ALLOCA_LISP (newargs, nargs1);
480 newargs[0] = value_to_lisp (fun); 480 newargs[0] = value_to_lisp (fun);
481 for (ptrdiff_t i = 0; i < nargs; i++) 481 for (ptrdiff_t i = 0; i < nargs; i++)
@@ -583,7 +583,7 @@ module_make_string (emacs_env *env, const char *str, ptrdiff_t length)
583{ 583{
584 MODULE_FUNCTION_BEGIN (module_nil); 584 MODULE_FUNCTION_BEGIN (module_nil);
585 if (! (0 <= length && length <= STRING_BYTES_BOUND)) 585 if (! (0 <= length && length <= STRING_BYTES_BOUND))
586 xsignal0 (Qoverflow_error); 586 overflow_error ();
587 /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated, 587 /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated,
588 but we shouldn't require that. */ 588 but we shouldn't require that. */
589 AUTO_STRING_WITH_LEN (lstr, str, length); 589 AUTO_STRING_WITH_LEN (lstr, str, length);
@@ -749,7 +749,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0,
749 if (r != 0) 749 if (r != 0)
750 { 750 {
751 if (FIXNUM_OVERFLOW_P (r)) 751 if (FIXNUM_OVERFLOW_P (r))
752 xsignal0 (Qoverflow_error); 752 overflow_error ();
753 xsignal2 (Qmodule_init_failed, file, make_fixnum (r)); 753 xsignal2 (Qmodule_init_failed, file, make_fixnum (r));
754 } 754 }
755 755