From: Guillermo J. Rozas Date: Wed, 2 Nov 1988 21:43:53 +0000 (+0000) Subject: Fix bug by which attempting to print a bogus object would kill Scheme. X-Git-Tag: 20090517-FFI~12467 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ee1ea36f3d09d8db1901eadd56158787b73f9f44;p=mit-scheme.git Fix bug by which attempting to print a bogus object would kill Scheme. It now prints #[UNDEFINED-TYPE: ] and does NOT hash the object. --- diff --git a/v7/src/runtime/unpars.scm b/v7/src/runtime/unpars.scm index 7c7faca34..a3a85e6e8 100644 --- a/v7/src/runtime/unpars.scm +++ b/v7/src/runtime/unpars.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/unpars.scm,v 14.7 1988/10/21 22:18:46 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/unpars.scm,v 14.8 1988/11/02 21:43:53 jinx Exp $ Copyright (c) 1988 Massachusetts Institute of Technology @@ -207,12 +207,15 @@ MIT in each case. |# ;;;; Unparser Methods (define (unparse/default object) - (let ((type (user-object-type object))) - (if (zero? (object-gc-type object)) - (*unparse-with-brackets type false - (lambda () - (*unparse-datum object))) - (*unparse-with-brackets type object false)))) + (let ((type (user-object-type object)) + (gc-type ((ucode-primitive primitive-object-gc-type 1) object))) + (case gc-type + ((1 2 3 4 -3 -4) ; cell pair triple quad vector compiled + (*unparse-with-brackets type object false)) + (else ; non pointer, gc special, undefined + (*unparse-with-brackets type false + (lambda () + (*unparse-datum object))))))) (define (user-object-type object) (let ((type-code (object-type object)))