Fix bug in fixnum-lsh. It was behaving like an arithmetic shift
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 16 Feb 1991 07:55:09 +0000 (07:55 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Sat, 16 Feb 1991 07:55:09 +0000 (07:55 +0000)
rather than a logical shift.

v7/src/microcode/fixnum.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 0a718316eab50c0162f9102c2c6d45ff8c590873..c83dcbda531b1a625f8766402ed4d8eb942a612b 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.32 1990/07/19 19:11:32 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fixnum.c,v 9.33 1991/02/16 07:54:26 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -49,6 +49,16 @@ arg_fixnum (n)
     error_wrong_type_arg (n);
   return (FIXNUM_TO_LONG (argument));
 }
+
+static long
+arg_unsigned_fixnum (n)
+     int n;
+{
+  fast SCHEME_OBJECT argument = (ARG_REF (n));
+  if (! (FIXNUM_P (argument)))
+    error_wrong_type_arg (n);
+  return (UNSIGNED_FIXNUM_TO_LONG (argument));
+}
 \f
 /* Predicates */
 
@@ -257,8 +267,8 @@ do                                                                  \
                                                                        \
   PRIMITIVE_HEADER (2);                                                        \
                                                                        \
-  x = (arg_fixnum (1));                                                        \
-  y = (arg_fixnum (2));                                                        \
+  x = (arg_unsigned_fixnum (1));                                       \
+  y = (arg_unsigned_fixnum (2));                                       \
                                                                        \
   z = (x operation y);                                                 \
   return (LONG_TO_FIXNUM (z));                                         \
@@ -295,7 +305,7 @@ DEFINE_PRIMITIVE ("FIXNUM-NOT", Prim_fixnum_not, 1, 1, 0)
 
   PRIMITIVE_HEADER (1);
 
-  x = (arg_fixnum (1));
+  x = (arg_unsigned_fixnum (1));
 
   z = (~ (x));
   return (LONG_TO_FIXNUM (z));
@@ -308,7 +318,7 @@ DEFINE_PRIMITIVE ("FIXNUM-LSH", Prim_fixnum_lsh, 2, 2, 0)
 
   PRIMITIVE_HEADER (2);
 
-  x = (arg_fixnum (1));
+  x = (arg_unsigned_fixnum (1));
   y = (arg_fixnum (2));
 
   if (y < 0)
index 62cb769b3893404f730d663661c27f7f46695d76..3d7ef117abb45fb1bd631b7c20c5af0ef00d5045 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.61 1991/01/24 11:26:20 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.62 1991/02/16 07:55:09 jinx Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     61
+#define SUBVERSION     62
 #endif
index b022a2d07de7495e0be7a3c57a38ed3a03dfac5b..c049ce8b4c76580bc69fe6e88ab56fe575d8743f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.61 1991/01/24 11:26:20 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.62 1991/02/16 07:55:09 jinx Exp $
 
 Copyright (c) 1988-91 Massachusetts Institute of Technology
 
@@ -46,5 +46,5 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     61
+#define SUBVERSION     62
 #endif