From: Chris Hanson Date: Wed, 6 Mar 1991 22:57:31 +0000 (+0000) Subject: Fix stack-address primitives to work on machines that don't have X-Git-Tag: 20090517-FFI~10876 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cef9eff3c12fa2e2e36913ebe7d784965e8a8389;p=mit-scheme.git Fix stack-address primitives to work on machines that don't have a trivial mapping between address and datum. --- diff --git a/v7/src/microcode/comutl.c b/v7/src/microcode/comutl.c index ee8f5399f..2ec18c261 100644 --- a/v7/src/microcode/comutl.c +++ b/v7/src/microcode/comutl.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.19 1989/09/20 23:07:04 cph Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/comutl.c,v 1.20 1991/03/06 22:57:31 cph Exp $ -Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology +Copyright (c) 1987-91 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -73,7 +73,7 @@ DEFINE_PRIMITIVE ("COMPILED-CODE-ADDRESS->OFFSET", Prim_comp_code_address_offset DEFINE_PRIMITIVE ("STACK-TOP-ADDRESS", Prim_stack_top_address, 0, 0, 0) { PRIMITIVE_HEADER (0); - PRIMITIVE_RETURN (long_to_integer ((long) (Stack_Top))); + PRIMITIVE_RETURN (long_to_integer ((long) (ADDRESS_TO_DATUM (Stack_Top)))); } DEFINE_PRIMITIVE ("STACK-ADDRESS-OFFSET", Prim_stack_address_offset, 1, 1, 0) @@ -83,9 +83,8 @@ DEFINE_PRIMITIVE ("STACK-ADDRESS-OFFSET", Prim_stack_address_offset, 1, 1, 0) CHECK_ARG (1, STACK_ADDRESS_P); PRIMITIVE_RETURN (long_to_integer - ((STACK_LOCATIVE_DIFFERENCE - (((long) (Stack_Top)), (OBJECT_DATUM (ARG_REF (1))))) - / (sizeof (SCHEME_OBJECT)))); + (STACK_LOCATIVE_DIFFERENCE ((Stack_Top), + (OBJECT_ADDRESS (ARG_REF (1)))))); } #endif /* USE_STACKLETS */