From: Chris Hanson Date: Fri, 10 May 1991 22:24:18 +0000 (+0000) Subject: Fix bug -- compiled-code environment manipulation was not allowing the X-Git-Tag: 20090517-FFI~10598 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e793866503c72e98b5828b01915d3407bc702f82;p=mit-scheme.git Fix bug -- compiled-code environment manipulation was not allowing the global environment as a valid interpreter environment. --- diff --git a/v7/src/runtime/uenvir.scm b/v7/src/runtime/uenvir.scm index 49bd12e41..dc7a12877 100644 --- a/v7/src/runtime/uenvir.scm +++ b/v7/src/runtime/uenvir.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uenvir.scm,v 14.22 1991/05/06 02:35:12 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uenvir.scm,v 14.23 1991/05/10 22:24:18 cph Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -153,6 +153,11 @@ MIT in each case. |# (or (system-global-environment? object) (ic-environment? object))) +(define (guarantee-interpreter-environment object) + (if (not (interpreter-environment? object)) + (error:wrong-type-datum object "interpreter environment")) + object) + (define-integrable (system-global-environment? object) (eq? system-global-environment object)) @@ -176,11 +181,6 @@ MIT in each case. |# (define-integrable (ic-environment? object) (object-type? (ucode-type environment) object)) -(define (guarantee-ic-environment object) - (if (not (ic-environment? object)) - (error "Bad IC environment" object)) - object) - (define (ic-environment/has-parent? environment) (not (eq? (ic-environment/parent environment) null-environment))) @@ -295,7 +295,7 @@ MIT in each case. |# ((IC) (let ((index (dbg-block/ic-parent-index block))) (if index - (guarantee-ic-environment + (guarantee-interpreter-environment (stack-frame/ref frame index)) default))) (else @@ -332,7 +332,7 @@ MIT in each case. |# parent entry)) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (compiled-code-block/environment (compiled-code-address->block entry)))) (else @@ -389,7 +389,7 @@ MIT in each case. |# parent (stack-ccenv/normal-closure environment))) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (if (dbg-block/static-link-index block) (stack-ccenv/static-link environment) (compiled-code-block/environment @@ -603,7 +603,7 @@ MIT in each case. |# (make-closure-ccenv parent closure-block closure) (use-simulation)))) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (let ((index (dbg-block/ic-parent-index closure-block))) (if index (closure/get-value closure closure-block index) diff --git a/v8/src/runtime/uenvir.scm b/v8/src/runtime/uenvir.scm index 411b5173b..c7ac2d458 100644 --- a/v8/src/runtime/uenvir.scm +++ b/v8/src/runtime/uenvir.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/uenvir.scm,v 14.22 1991/05/06 02:35:12 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/uenvir.scm,v 14.23 1991/05/10 22:24:18 cph Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -153,6 +153,11 @@ MIT in each case. |# (or (system-global-environment? object) (ic-environment? object))) +(define (guarantee-interpreter-environment object) + (if (not (interpreter-environment? object)) + (error:wrong-type-datum object "interpreter environment")) + object) + (define-integrable (system-global-environment? object) (eq? system-global-environment object)) @@ -176,11 +181,6 @@ MIT in each case. |# (define-integrable (ic-environment? object) (object-type? (ucode-type environment) object)) -(define (guarantee-ic-environment object) - (if (not (ic-environment? object)) - (error "Bad IC environment" object)) - object) - (define (ic-environment/has-parent? environment) (not (eq? (ic-environment/parent environment) null-environment))) @@ -295,7 +295,7 @@ MIT in each case. |# ((IC) (let ((index (dbg-block/ic-parent-index block))) (if index - (guarantee-ic-environment + (guarantee-interpreter-environment (stack-frame/ref frame index)) default))) (else @@ -332,7 +332,7 @@ MIT in each case. |# parent entry)) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (compiled-code-block/environment (compiled-code-address->block entry)))) (else @@ -389,7 +389,7 @@ MIT in each case. |# parent (stack-ccenv/normal-closure environment))) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (if (dbg-block/static-link-index block) (stack-ccenv/static-link environment) (compiled-code-block/environment @@ -603,7 +603,7 @@ MIT in each case. |# (make-closure-ccenv parent closure-block closure) (use-simulation)))) ((IC) - (guarantee-ic-environment + (guarantee-interpreter-environment (let ((index (dbg-block/ic-parent-index closure-block))) (if index (closure/get-value closure closure-block index)