From: Paul Eggert Date: Tue, 19 Apr 2011 01:11:43 +0000 (-0700) Subject: * fns.c (internal_equal): Don't assume size_t fits in int. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~251 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9b821a2194577b868c4da4de78a3f35d5957f10f;p=emacs.git * fns.c (internal_equal): Don't assume size_t fits in int. --- 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; }