]> git.eshelyaron.com Git - emacs.git/commit
Don't use 'args-out-of-range' error for too-small buffers.
authorPhilipp Stephani <p.stephani2@gmail.com>
Tue, 25 Mar 2025 01:50:37 +0000 (02:50 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 25 Mar 2025 18:19:47 +0000 (19:19 +0100)
commit577b06604248f2c6c9a3d7904fc518df5e79da5f
tree950a4eaedbc017842b39b836e48d377d45afdd39
parent31abd3a840ba4a51b9900a8d0740dc933dfab0a0
Don't use 'args-out-of-range' error for too-small buffers.

'args-out-of-range' means that some index argument isn't valid for a
given sequence/range, which isn't the case here.  Instead, define a new
error symbol to mean "user-supplied buffer is too small."  Since we
never specified nor tested which error symbol was signalled in this
case, changing it shouldn't cause severe breakages.

* src/emacs-module.c (module_buffer_too_small): New helper function.
(module_copy_string_contents, module_extract_big_integer): Use it.
(syms_of_module): Define 'buffer-too-small' error symbol.

(cherry picked from commit 96a1a07fb1f9d8f3f41f3893ed1b624246a76c43)
src/emacs-module.c