Pacify Apple clang 11 __builtin_assume
Problem reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00300.html * src/lisp.h (bool_vector_bitref, bool_vector_set): Use eassert instead of eassume for bool_vector_size checks.
This commit is contained in:
parent
e365b9ab7b
commit
f712cdbe9e
1 changed files with 6 additions and 5 deletions
11
src/lisp.h
11
src/lisp.h
|
@ -1809,7 +1809,8 @@ bool_vector_uchar_data (Lisp_Object a)
|
|||
INLINE bool
|
||||
bool_vector_bitref (Lisp_Object a, EMACS_INT i)
|
||||
{
|
||||
eassume (0 <= i && i < bool_vector_size (a));
|
||||
eassume (0 <= i);
|
||||
eassert (i < bool_vector_size (a));
|
||||
return !! (bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR]
|
||||
& (1 << (i % BOOL_VECTOR_BITS_PER_CHAR)));
|
||||
}
|
||||
|
@ -1825,11 +1826,11 @@ bool_vector_ref (Lisp_Object a, EMACS_INT i)
|
|||
INLINE void
|
||||
bool_vector_set (Lisp_Object a, EMACS_INT i, bool b)
|
||||
{
|
||||
unsigned char *addr;
|
||||
|
||||
eassume (0 <= i && i < bool_vector_size (a));
|
||||
addr = &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR];
|
||||
eassume (0 <= i);
|
||||
eassert (i < bool_vector_size (a));
|
||||
|
||||
unsigned char *addr
|
||||
= &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR];
|
||||
if (b)
|
||||
*addr |= 1 << (i % BOOL_VECTOR_BITS_PER_CHAR);
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue