Fix bug in code that detects whether the manifest closure count can be read.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 6 Dec 1989 05:49:28 +0000 (05:49 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 6 Dec 1989 05:49:28 +0000 (05:49 +0000)
The area forced to memory did not in fact include the count, so the
count read was garbage.

v7/src/microcode/bchdmp.c
v7/src/microcode/bchgcl.c
v7/src/microcode/bchpur.c

index 1a423401cc1716e435dbc95149f9760a77041990..4bc1663cc3abf69e0e14f4b57277ef3267cbfe94 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.47 1989/11/26 17:38:13 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.48 1989/12/06 05:49:28 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -421,12 +421,13 @@ dumploop(Scan, To_ptr, To_Address_ptr)
 
        Scan += 1;
        /* Is there enough space to read the count? */
-       if ((((char *) Scan) + 2) > ((char *) scan_buffer_top))
+       if ((((char *) Scan) + (2 * (sizeof (format_word)))) >
+           ((char *) scan_buffer_top))
        {
          long dw;
          char *header_end;
 
-         header_end = (((char *) Scan) + 2);
+         header_end = (((char *) Scan) + (2 * (sizeof (format_word))));
          extend_scan_buffer (((char *) header_end), To);
          count = (MANIFEST_CLOSURE_COUNT (Scan));
          word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
@@ -434,7 +435,8 @@ dumploop(Scan, To_ptr, To_Address_ptr)
          header_end = ((char *)
                        (end_scan_buffer_extension ((char *) header_end)));
          word_ptr = (header_end + dw);
-         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+         Scan = ((SCHEME_OBJECT *)
+                 (header_end - (2 * (sizeof (format_word)))));
        }
        else
        {
index 6ec20b1b0eaa57bdd514b1438a72fbd7e2f162bf..793d16fe874ed4cebad70c0e1e694e78c10176ed 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.38 1989/11/26 17:38:18 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.39 1989/12/06 05:48:50 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -178,12 +178,13 @@ GCLoop(Scan, To_ptr, To_Address_ptr)
 
        Scan += 1;
        /* Is there enough space to read the count? */
-       if ((((char *) Scan) + 2) > ((char *) scan_buffer_top))
+       if ((((char *) Scan) + (2 * (sizeof (format_word)))) >
+           ((char *) scan_buffer_top))
        {
          long dw;
          char *header_end;
 
-         header_end = (((char *) Scan) + 2);
+         header_end = (((char *) Scan) + (2 * (sizeof (format_word))));
          extend_scan_buffer (((char *) header_end), To);
          count = (MANIFEST_CLOSURE_COUNT (Scan));
          word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
@@ -191,7 +192,8 @@ GCLoop(Scan, To_ptr, To_Address_ptr)
          header_end = ((char *)
                        (end_scan_buffer_extension ((char *) header_end)));
          word_ptr = (header_end + dw);
-         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+         Scan = ((SCHEME_OBJECT *)
+                 (header_end - (2 * (sizeof (format_word)))));
        }
        else
        {
index 488cd39c84e099e9af9df84b8e9f11fbadf8c507..3de442de6b25b2ac541da698152daa297c6552ae 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchpur.c,v 9.47 1989/11/26 17:38:22 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchpur.c,v 9.48 1989/12/06 05:49:09 jinx Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -231,12 +231,13 @@ purifyloop(Scan, To_ptr, To_Address_ptr, purify_mode)
 
        Scan += 1;
        /* Is there enough space to read the count? */
-       if ((((char *) Scan) + 2) > ((char *) scan_buffer_top))
+       if ((((char *) Scan) + (2 * (sizeof (format_word)))) >
+           ((char *) scan_buffer_top))
        {
          long dw;
          char *header_end;
 
-         header_end = (((char *) Scan) + 2);
+         header_end = (((char *) Scan) + (2 * (sizeof (format_word))));
          extend_scan_buffer (((char *) header_end), To);
          count = (MANIFEST_CLOSURE_COUNT (Scan));
          word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan));
@@ -244,7 +245,8 @@ purifyloop(Scan, To_ptr, To_Address_ptr, purify_mode)
          header_end = ((char *)
                        (end_scan_buffer_extension ((char *) header_end)));
          word_ptr = (header_end + dw);
-         Scan = ((SCHEME_OBJECT *) (header_end - 2));
+         Scan = ((SCHEME_OBJECT *)
+                 (header_end - (2 * (sizeof (format_word)))));
        }
        else
        {