]> git.eshelyaron.com Git - emacs.git/commitdiff
* fns.c (internal_equal): Don't assume size_t fits in int.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2011 01:11:43 +0000 (18:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Apr 2011 01:11:43 +0000 (18:11 -0700)
src/ChangeLog
src/fns.c

index 4af83e1d97360a778844c01d12eda1527b36153a..ef511ffc21142504b5f09ae3a5029da9dc9ab75b 100644 (file)
@@ -1,5 +1,7 @@
 2011-04-19  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * 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.
index 3771820753e756329536e9cf20f9bff3e9cf4340..20190399f9ab08b0ba9d1bafed488e7f71519aac 100644 (file)
--- 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;
          }