emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/fns.c


From: Andreas Schwab
Subject: [Emacs-diffs] Changes to emacs/src/fns.c
Date: Tue, 25 Nov 2003 07:21:47 -0500

Index: emacs/src/fns.c
diff -c emacs/src/fns.c:1.349 emacs/src/fns.c:1.350
*** emacs/src/fns.c:1.349       Sat Nov 22 22:12:45 2003
--- emacs/src/fns.c     Tue Nov 25 07:21:46 2003
***************
*** 2192,2199 ****
  
      case Lisp_Vectorlike:
        {
!       register int i, size;
!       size = XVECTOR (o1)->size;
        /* Pseudovectors have the type encoded in the size field, so this test
           actually checks that the objects have the same type as well as the
           same size.  */
--- 2192,2199 ----
  
      case Lisp_Vectorlike:
        {
!       register int i;
!       EMACS_INT size = XVECTOR (o1)->size;
        /* Pseudovectors have the type encoded in the size field, so this test
           actually checks that the objects have the same type as well as the
           same size.  */
***************
*** 2315,2322 ****
        = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
  
        charval = (! NILP (item) ? -1 : 0);
!       for (index = 0; index < size_in_chars; index++)
        p[index] = charval;
      }
    else
      {
--- 2315,2329 ----
        = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR;
  
        charval = (! NILP (item) ? -1 : 0);
!       for (index = 0; index < size_in_chars - 1; index++)
        p[index] = charval;
+       if (index < size_in_chars)
+       {
+         /* Mask out bits beyond the vector size.  */
+         if (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)
+           charval &= (1 << (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)) - 1;
+         p[index] = charval;
+       }
      }
    else
      {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]