changeset 21935:8dad06385435

(read1): Clear out extraneous bits at end of bool-vector.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 04 May 1998 15:29:47 +0000
parents 809dbde64976
children 6635a9f225a9
files src/lread.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Mon May 04 15:12:05 1998 +0000
+++ b/src/lread.c	Mon May 04 15:29:47 1998 +0000
@@ -1512,6 +1512,10 @@
 	      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),