From 83caf4fdea4bdd115e8a24b5537eb1edacaab4be Mon Sep 17 00:00:00 2001 From: Arthur Gleckler Date: Tue, 28 Jun 1988 20:53:49 +0000 Subject: [PATCH] Procedure fixnum-constant didn't realize that maximum-positive-fixnum is one less than the absolute value of the least (negative) fixnum. --- v7/src/compiler/machines/bobcat/lapgen.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v7/src/compiler/machines/bobcat/lapgen.scm b/v7/src/compiler/machines/bobcat/lapgen.scm index 9cf55f1c1..0403ec6a0 100644 --- a/v7/src/compiler/machines/bobcat/lapgen.scm +++ b/v7/src/compiler/machines/bobcat/lapgen.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/lapgen.scm,v 4.9 1988/06/14 08:47:38 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/bobcat/lapgen.scm,v 4.10 1988/06/28 20:53:49 arthur Exp $ Copyright (c) 1988 Massachusetts Institute of Technology @@ -350,9 +350,9 @@ MIT in each case. |# (INST (MOV B (& ,type-code) ,effective-address)))) (define (fixnum-constant x) - (if (<= (abs x) maximum-positive-fixnum) - x - (error "Not a fixnum" x))) + (cond ((<= x maximum-positive-fixnum) x) + ((>= x (- (1+ maximum-positive-fixnum))) x) + (else (error "Not a fixnum" x)))) (define (fixnum-expression? expression) ;; input: an rtl expression -- 2.25.1