diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-20 08:51:13 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-11-20 08:51:42 -0800 |
commit | e61f1c3c8bd852ea8357047a408c8af56bc9918c (patch) | |
tree | 0389d127311a28c4a7b5b69d87d22f0cc9b89c9c /lisp/emacs-lisp/byte-run.el | |
parent | c0c309e4cd618ef660b04a13e5fc68c1a43031a6 (diff) | |
download | emacs-e61f1c3c8bd852ea8357047a408c8af56bc9918c.tar.gz emacs-e61f1c3c8bd852ea8357047a408c8af56bc9918c.tar.bz2 emacs-e61f1c3c8bd852ea8357047a408c8af56bc9918c.zip |
Module function arg counts are ptrdiff_t, not int
* src/emacs-module.c (struct module_fun_env)
(module_make_function, module_funcall, Fmodule_call):
* src/emacs-module.h (struct emacs_runtime, struct emacs_env_25):
Use ptrdiff_t, not int, for arg counts.
* src/emacs-module.c (module_make_function): Don’t bother
checking arity against MOST_POSITIVE_FIXNUM, as that’s
unnecessary here. Make the checking clearer by negating it.
(module_make_function, Fmodule_call): No need to use xzalloc
since the storage doesn’t need to be cleared.
(module_funcall): Don’t use VLA, since C11 doesn’t guarantee support
for it, and many implementations are buggy with large VLAs anyway.
Use SAFE_ALLOCA_LISP instead.
(module_vec_set): Don’t crash if i < 0.
(module_vec_get): Don’t crash if i < MOST_NEGATIVE_FIXNUM.
(module_vec_set, module_vec_get): Do fixnum checks only when
i is out of array bounds, for efficiency in the usual case.
(Fmodule_load): Simplify fixnum range check.
(Fmodule_call): Simplify arity check. Use xnmalloc to detect
integer overflow in array allocation size.
Diffstat (limited to 'lisp/emacs-lisp/byte-run.el')
0 files changed, 0 insertions, 0 deletions