Fix off-by-one error in bit-string->unsigned-integer.
authorHal Abelson <edu/mit/hal>
Thu, 31 Jan 1991 07:00:00 +0000 (07:00 +0000)
committerHal Abelson <edu/mit/hal>
Thu, 31 Jan 1991 07:00:00 +0000 (07:00 +0000)
If the bit-string has exactly FIXNUM_LENGTH bits, it still
falls in the fixnum range.

v7/src/microcode/bitstr.c

index b4e115e9e67ea37e727318bb60228d42ec13bc67..a31954cc5ae8bc082a545cbd6b62a1442d314581 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/bitstr.c,v 9.46 1990/09/20 03:02:26 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/bitstr.c,v 9.47 1991/01/31 07:00:00 hal Exp $
 
 Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -807,7 +807,7 @@ DEFINE_PRIMITIVE ("BIT-STRING->UNSIGNED-INTEGER", Prim_bit_string_to_unsigned, 1
     PRIMITIVE_RETURN (LONG_TO_UNSIGNED_FIXNUM (0));
   nbits = (((nwords - 1) * OBJECT_LENGTH) + (long_significant_bits (word)));
   PRIMITIVE_RETURN
-    ((nbits < FIXNUM_LENGTH)
+    ((nbits <= FIXNUM_LENGTH)
      ? (LONG_TO_UNSIGNED_FIXNUM (word))
      : (bit_string_to_bignum (nbits, bit_string)));
 }