From 6120b7cf265bdfb093c0302e4b19a7c76f74f93d Mon Sep 17 00:00:00 2001 From: Hal Abelson Date: Thu, 31 Jan 1991 07:00:00 +0000 Subject: [PATCH] Fix off-by-one error in bit-string->unsigned-integer. If the bit-string has exactly FIXNUM_LENGTH bits, it still falls in the fixnum range. --- v7/src/microcode/bitstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v7/src/microcode/bitstr.c b/v7/src/microcode/bitstr.c index b4e115e9e..a31954cc5 100644 --- a/v7/src/microcode/bitstr.c +++ b/v7/src/microcode/bitstr.c @@ -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))); } -- 2.25.1