]> git.eshelyaron.com Git - emacs.git/commitdiff
Mimic behavior of 'aref' when signalling out-of-range errors.
authorPhilipp Stephani <p.stephani2@gmail.com>
Tue, 25 Mar 2025 01:56:01 +0000 (02:56 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 25 Mar 2025 18:19:49 +0000 (19:19 +0100)
The convention used by 'aref' and friends is that for
'args-out-of-range', the error data is a list (SEQ INDEX).  Use the same
convention for the vector-related module functions.

* src/emacs-module.c (check_vec_index): Use vector and index as error
data.

(cherry picked from commit 8efcdcab8658ff9537fe483e0a12875cca90a527)

src/emacs-module.c

index a8386856da7dfd2e4fa73304b191e7453d7cf9e5..32b78b0d9782da3323adeb74b6568225ce4c3f7a 100644 (file)
@@ -925,8 +925,7 @@ check_vec_index (Lisp_Object lvec, ptrdiff_t i)
 {
   CHECK_VECTOR (lvec);
   if (! (0 <= i && i < ASIZE (lvec)))
-    args_out_of_range_3 (INT_TO_INTEGER (i),
-                        make_fixnum (0), make_fixnum (ASIZE (lvec) - 1));
+    args_out_of_range (lvec, INT_TO_INTEGER (i));
 }
 
 static void