From 1009b912b94e28ed79f3c84a6105488f85511572 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Thu, 8 Jun 1989 00:19:13 +0000 Subject: [PATCH] Add new flags to the microcode: BAD_TYPES_INNOCUOUS If a bad type is seen, the system treats it as a non-pointer for most purposes. BAD_TYPES_LETHAL If a bad type is seen, kill Scheme with TERM_INVALID_TYPE_CODE. The default is BAD_TYPES_LETHAL when there is no compiler support, BAD_TYPES_INNOCUOUS when there is. --- v7/src/microcode/bchdmp.c | 19 ++++++++----------- v7/src/microcode/bchgcl.c | 18 ++++++++---------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/v7/src/microcode/bchdmp.c b/v7/src/microcode/bchdmp.c index c9f20d8ca..22b988f32 100644 --- a/v7/src/microcode/bchdmp.c +++ b/v7/src/microcode/bchdmp.c @@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising, promotional, or sales literature without prior written consent from MIT in each case. */ -/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.43 1988/08/15 20:35:56 cph Exp $ */ +/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchdmp.c,v 9.44 1989/06/08 00:19:08 jinx Rel $ */ /* bchgcl, bchmmg, bchpur, and bchdmp can replace gcloop, memmag, purify, and fasdump, respectively, to provide garbage collection @@ -337,10 +337,6 @@ dumploop(Scan, To_ptr, To_Address_ptr) case TC_PCOMB0: *Scan = dump_renumber_primitive(*Scan); break; - - case TC_STACK_ENVIRONMENT: - case_Fasload_Non_Pointer: - break; case_compiled_entry_point: fasdump_compiled_entry(); @@ -540,12 +536,13 @@ dumploop(Scan, To_ptr, To_Address_ptr) continue; default: - sprintf(gc_death_message_buffer, - "dumploop: bad type code (0x%02x)", - OBJECT_TYPE(Temp)); - gc_death(TERM_INVALID_TYPE_CODE, gc_death_message_buffer, - Scan, To); - /*NOTREACHED*/ + GC_BAD_TYPE("dumploop"); + /* Fall Through */ + + case TC_STACK_ENVIRONMENT: + case_Fasload_Non_Pointer: + break; + } } end_dumploop: diff --git a/v7/src/microcode/bchgcl.c b/v7/src/microcode/bchgcl.c index 634f0c148..959451d24 100644 --- a/v7/src/microcode/bchgcl.c +++ b/v7/src/microcode/bchgcl.c @@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising, promotional, or sales literature without prior written consent from MIT in each case. */ -/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.34 1988/08/15 20:36:15 cph Exp $ */ +/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bchgcl.c,v 9.35 1989/06/08 00:19:13 jinx Rel $ */ /* bchgcl, bchmmg, bchpur, and bchdmp can replace gcloop, memmag, purify, and fasdump, respectively, to provide garbage collection @@ -82,7 +82,9 @@ GCLoop(Scan, To_ptr, To_Address_ptr) and if so we need a new bufferfull. */ Scan += Get_Integer(Temp); if (Scan < scan_buffer_top) + { break; + } else { unsigned long overflow; @@ -93,9 +95,6 @@ GCLoop(Scan, To_ptr, To_Address_ptr) (overflow % GC_DISK_BUFFER_SIZE)) - 1); break; } - - case_Non_Pointer: - break; case_compiled_entry_point: relocate_compiled_entry(true); @@ -260,12 +259,11 @@ GCLoop(Scan, To_ptr, To_Address_ptr) relocate_normal_pointer(copy_weak_pair(), 2); default: - sprintf(gc_death_message_buffer, - "gcloop: bad type code (0x%02x)", - OBJECT_TYPE(Temp)); - gc_death(TERM_INVALID_TYPE_CODE, gc_death_message_buffer, - Scan, To); - /*NOTREACHED*/ + GC_BAD_TYPE("gcloop"); + /* Fall Through */ + + case_Non_Pointer: + break; } } end_gcloop: -- 2.25.1