]> git.eshelyaron.com Git - emacs.git/commitdiff
(read1): Clear out extraneous bits at end of bool-vector.
authorEli Zaretskii <eliz@gnu.org>
Mon, 4 May 1998 15:29:47 +0000 (15:29 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 4 May 1998 15:29:47 +0000 (15:29 +0000)
src/lread.c

index 44d071e97e22b7b407d7a39c94cf312bd0eeaaa6..1f4a8c5e093c4d713d124d99c0906f52bd63ed30 100644 (file)
@@ -1512,6 +1512,10 @@ read1 (readcharfun, pch, first_in_list)
              val = Fmake_bool_vector (length, Qnil);
              bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data,
                     size_in_chars);
+             /* Clear the extraneous bits in the last byte.  */
+             if (XINT (length) != size_in_chars * BITS_PER_CHAR)
+               XBOOL_VECTOR (val)->data[size_in_chars - 1]
+                 &= (1 << (XINT (length) % BITS_PER_CHAR)) - 1;
              return val;
            }
          Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5),