diff options
| author | Paul Eggert | 2019-10-18 13:21:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-10-18 13:23:11 -0700 |
| commit | f3aa05b1aad055452093350785ea05d4a64142dd (patch) | |
| tree | 41914a875b2fa4b055bfdedb4b66bcc6868a2b54 /src | |
| parent | b72ff3667a137ca5d03f6a5c3cff722f004bc8ed (diff) | |
| download | emacs-f3aa05b1aad055452093350785ea05d4a64142dd.tar.gz emacs-f3aa05b1aad055452093350785ea05d4a64142dd.zip | |
Generalize list1i etc. to all signed integer types
* src/lisp.h (list1i, list2i, list3i, list4i):
Accept intmax_t instead of EMACS_INT, and use make_int instead
of make_fixnum. This should help avoid integer-overflow
problems akin to the Time bug (Bug#37795).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lisp.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/lisp.h b/src/lisp.h index fe20add2d70..04fa1d64eab 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3862,28 +3862,27 @@ extern void visit_static_gc_roots (struct gc_root_visitor visitor); | |||
| 3862 | /* Build a frequently used 1/2/3/4-integer lists. */ | 3862 | /* Build a frequently used 1/2/3/4-integer lists. */ |
| 3863 | 3863 | ||
| 3864 | INLINE Lisp_Object | 3864 | INLINE Lisp_Object |
| 3865 | list1i (EMACS_INT x) | 3865 | list1i (intmax_t a) |
| 3866 | { | 3866 | { |
| 3867 | return list1 (make_fixnum (x)); | 3867 | return list1 (make_int (a)); |
| 3868 | } | 3868 | } |
| 3869 | 3869 | ||
| 3870 | INLINE Lisp_Object | 3870 | INLINE Lisp_Object |
| 3871 | list2i (EMACS_INT x, EMACS_INT y) | 3871 | list2i (intmax_t a, intmax_t b) |
| 3872 | { | 3872 | { |
| 3873 | return list2 (make_fixnum (x), make_fixnum (y)); | 3873 | return list2 (make_int (a), make_int (b)); |
| 3874 | } | 3874 | } |
| 3875 | 3875 | ||
| 3876 | INLINE Lisp_Object | 3876 | INLINE Lisp_Object |
| 3877 | list3i (EMACS_INT x, EMACS_INT y, EMACS_INT w) | 3877 | list3i (intmax_t a, intmax_t b, intmax_t c) |
| 3878 | { | 3878 | { |
| 3879 | return list3 (make_fixnum (x), make_fixnum (y), make_fixnum (w)); | 3879 | return list3 (make_int (a), make_int (b), make_int (c)); |
| 3880 | } | 3880 | } |
| 3881 | 3881 | ||
| 3882 | INLINE Lisp_Object | 3882 | INLINE Lisp_Object |
| 3883 | list4i (EMACS_INT x, EMACS_INT y, EMACS_INT w, EMACS_INT h) | 3883 | list4i (intmax_t a, intmax_t b, intmax_t c, intmax_t d) |
| 3884 | { | 3884 | { |
| 3885 | return list4 (make_fixnum (x), make_fixnum (y), | 3885 | return list4 (make_int (a), make_int (b), make_int (c), make_int (d)); |
| 3886 | make_fixnum (w), make_fixnum (h)); | ||
| 3887 | } | 3886 | } |
| 3888 | 3887 | ||
| 3889 | extern Lisp_Object make_uninit_bool_vector (EMACS_INT); | 3888 | extern Lisp_Object make_uninit_bool_vector (EMACS_INT); |