From: Guillermo J. Rozas Date: Wed, 6 Dec 1989 05:49:28 +0000 (+0000) Subject: Fix bug in code that detects whether the manifest closure count can be read. X-Git-Tag: 20090517-FFI~11627 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=5f816c7967229a0fa33b308b19282b7176d239e2;p=mit-scheme.git Fix bug in code that detects whether the manifest closure count can be read. The area forced to memory did not in fact include the count, so the count read was garbage. --- diff --git a/v7/src/microcode/bchdmp.c b/v7/src/microcode/bchdmp.c index 1a423401c..4bc1663cc 100644 --- a/v7/src/microcode/bchdmp.c +++ b/v7/src/microcode/bchdmp.c @@ -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 { diff --git a/v7/src/microcode/bchgcl.c b/v7/src/microcode/bchgcl.c index 6ec20b1b0..793d16fe8 100644 --- a/v7/src/microcode/bchgcl.c +++ b/v7/src/microcode/bchgcl.c @@ -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 { diff --git a/v7/src/microcode/bchpur.c b/v7/src/microcode/bchpur.c index 488cd39c8..3de442de6 100644 --- a/v7/src/microcode/bchpur.c +++ b/v7/src/microcode/bchpur.c @@ -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 {