Bugs: `object-gc-type' was using `MAKE_UNSIGNED_FIXNUM' to compute its
authorChris Hanson <org/chris-hanson/cph>
Wed, 11 May 1988 17:21:16 +0000 (17:21 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 11 May 1988 17:21:16 +0000 (17:21 +0000)
result when in fact the result was signed.  `object-set-type' was
going to `Microcode_Termination' when its first argument was an
unknown type code, rather than signalling a bad-range error.

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

index fb9df150ea578bd1d89258411c914303ac26a3be..b98ea8eab7380eba511cd2b64bb1de92a8659caf 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prim.c,v 9.29 1988/03/24 07:12:47 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/prim.c,v 9.30 1988/05/11 17:20:18 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -56,7 +56,8 @@ DEFINE_PRIMITIVE ("PRIMITIVE-OBJECT-GC-TYPE", Prim_prim_obj_gc_type, 1)
 {
   PRIMITIVE_HEADER (1); 
 
-  PRIMITIVE_RETURN (MAKE_UNSIGNED_FIXNUM (GC_Type (ARG_REF (1))));
+  PRIMITIVE_RETURN
+    (MAKE_SIGNED_FIXNUM (GC_Type_Map [OBJECT_TYPE (ARG_REF (1))]));
 }
 
 /* (PRIMITIVE-OBJECT-TYPE? TYPE-CODE OBJECT)
@@ -173,7 +174,7 @@ DEFINE_PRIMITIVE ("OBJECT-GC-TYPE", Prim_object_gc_type, 1)
   PRIMITIVE_HEADER (1); 
 
   Touch_In_Primitive ((ARG_REF (1)), object);
-  PRIMITIVE_RETURN (MAKE_UNSIGNED_FIXNUM (GC_Type (object)));
+  PRIMITIVE_RETURN (MAKE_SIGNED_FIXNUM (GC_Type (object)));
 }
 
 DEFINE_PRIMITIVE ("OBJECT-TYPE?", Prim_object_type_p, 2)
@@ -201,16 +202,20 @@ DEFINE_PRIMITIVE ("OBJECT-DATUM", Prim_object_datum, 1)
 DEFINE_PRIMITIVE ("OBJECT-SET-TYPE", Prim_object_set_type, 2)
 {
   fast long type_code;
-  fast long gc_type_code;
   fast Pointer object;
   PRIMITIVE_HEADER (2);
 
   type_code = (arg_index_integer (1, (MAX_TYPE_CODE + 1)));
-  gc_type_code = (GC_Type_Code (type_code));
   Touch_In_Primitive ((ARG_REF (2)), object);
-  if ((gc_type_code != (GC_Type (object))) &&
-      (gc_type_code != GC_Non_Pointer))
-    error_bad_range_arg (1);
+  {
+    fast long gc_type_code;
+
+    gc_type_code = (GC_Type_Map [type_code]);
+    if ((gc_type_code == GC_Undefined) ||
+       (! ((gc_type_code == GC_Non_Pointer) ||
+           (gc_type_code == (GC_Type (object))))))
+      error_bad_range_arg (1);
+  }
   PRIMITIVE_RETURN (Make_New_Pointer (type_code, object));
 }
 
index 2484d86354f78cb8a31a64118c9420b0ed7868cf..a94404e01ba37a1514ec4db790c8d59bbf95bd53 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.38 1988/05/10 18:14:04 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.39 1988/05/11 17:21:16 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     38
+#define SUBVERSION     39
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 98fcc768697377813628b8dfbc27fc39fb401486..4206c31f03e04a5062a53a434ca9d05df6cf697e 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.38 1988/05/10 18:14:04 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.39 1988/05/11 17:21:16 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     38
+#define SUBVERSION     39
 #endif
 
 #ifndef UCODE_TABLES_FILENAME