From af5ae2357fd3d729dc873edc66edd84b13923d88 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 2 Mar 2012 19:34:50 +0000 Subject: [PATCH] Fix fencepost typo in integer_shift_left. Now (fixnum? (expt 2 24)) returns #t as it should. --- src/microcode/artutl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microcode/artutl.c b/src/microcode/artutl.c index b6efff0e5..091f6b50d 100644 --- a/src/microcode/artutl.c +++ b/src/microcode/artutl.c @@ -675,7 +675,7 @@ integer_shift_left (SCHEME_OBJECT n, unsigned long m) long n1 = (FIXNUM_TO_LONG (n)); if (n1 < 0) { - if ((m + (ulong_length_in_bits (~n1))) < FIXNUM_LENGTH) + if ((m + (ulong_length_in_bits (~n1))) <= FIXNUM_LENGTH) /* The behaviour of shifting a negative integer is undefined in C. */ return (LONG_TO_FIXNUM (- ((-n1) << m))); @@ -685,7 +685,7 @@ integer_shift_left (SCHEME_OBJECT n, unsigned long m) } else if (0 < n1) { - if ((m + (ulong_length_in_bits (n1))) < FIXNUM_LENGTH) + if ((m + (ulong_length_in_bits (n1))) <= FIXNUM_LENGTH) return (LONG_TO_FIXNUM (n1 << m)); else return (unsigned_long_to_shifted_bignum (n1, m, 0)); -- 2.25.1