1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00

Replace PVEC_FONT as pseudo-vector subtype upper bound

* src/lisp.h (enum pvec_type): Add PVEC_TAG_MAX.
* src/alloc.c (allocate_pseudovector): Use PVEC_TAG_MAX instead of
PVEC_FONT.
This commit is contained in:
Mattias Engdegård 2023-09-10 13:24:57 +02:00
parent 2f8204f5c3
commit 90b8762ac8
2 changed files with 3 additions and 2 deletions

View File

@ -3613,7 +3613,7 @@ allocate_pseudovector (int memlen, int lisplen,
enum { size_max = (1 << PSEUDOVECTOR_SIZE_BITS) - 1 }; enum { size_max = (1 << PSEUDOVECTOR_SIZE_BITS) - 1 };
enum { rest_max = (1 << PSEUDOVECTOR_REST_BITS) - 1 }; enum { rest_max = (1 << PSEUDOVECTOR_REST_BITS) - 1 };
verify (size_max + rest_max <= VECTOR_ELTS_MAX); verify (size_max + rest_max <= VECTOR_ELTS_MAX);
eassert (0 <= tag && tag <= PVEC_FONT); eassert (0 <= tag && tag <= PVEC_TAG_MAX);
eassert (0 <= lisplen && lisplen <= zerolen && zerolen <= memlen); eassert (0 <= lisplen && lisplen <= zerolen && zerolen <= memlen);
eassert (lisplen <= size_max); eassert (lisplen <= size_max);
eassert (memlen <= size_max + rest_max); eassert (memlen <= size_max + rest_max);

View File

@ -1086,7 +1086,8 @@ enum pvec_type
PVEC_CHAR_TABLE, PVEC_CHAR_TABLE,
PVEC_SUB_CHAR_TABLE, PVEC_SUB_CHAR_TABLE,
PVEC_RECORD, PVEC_RECORD,
PVEC_FONT /* Should be last because it's used for range checking. */ PVEC_FONT,
PVEC_TAG_MAX = PVEC_FONT /* Keep this equal to the highest member. */
}; };
enum More_Lisp_Bits enum More_Lisp_Bits