From 9b821a2194577b868c4da4de78a3f35d5957f10f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 18 Apr 2011 18:11:43 -0700 Subject: [PATCH] * fns.c (internal_equal): Don't assume size_t fits in int. --- src/ChangeLog | 2 ++ src/fns.c | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4af83e1d973..ef511ffc211 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-04-19 Paul Eggert + * fns.c (internal_equal): Don't assume size_t fits in int. + * alloc.c (compact_small_strings): Tighten assertion a little. Replace pEd with more-general pI, and fix some printf arg casts. diff --git a/src/fns.c b/src/fns.c index 3771820753e..20190399f9a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2063,14 +2063,12 @@ internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int /* Boolvectors are compared much like strings. */ if (BOOL_VECTOR_P (o1)) { - int size_in_chars - = ((XBOOL_VECTOR (o1)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) - / BOOL_VECTOR_BITS_PER_CHAR); - if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size) return 0; if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data, - size_in_chars)) + ((XBOOL_VECTOR (o1)->size + + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR))) return 0; return 1; } -- 2.39.2