From: Chris Hanson <org/chris-hanson/cph>
Date: Tue, 7 Feb 2017 05:49:15 +0000 (-0800)
Subject: Fix bug: typo broke linear dispatch coding.
X-Git-Tag: mit-scheme-pucked-9.2.12~220^2~169
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d9df2f28b224c955dd452de888d331be1a32f15c;p=mit-scheme.git

Fix bug: typo broke linear dispatch coding.
---

diff --git a/src/etc/ucd-converter.scm b/src/etc/ucd-converter.scm
index 304ebd3c3..4b4e6cfb5 100644
--- a/src/etc/ucd-converter.scm
+++ b/src/etc/ucd-converter.scm
@@ -641,10 +641,10 @@ USA.
   (and (pair? indexes)
        (pair? (cdr indexes))
        (let ((slope (- (cadr indexes) (car indexes))))
-         (let loop ((indexes (cdr indexes)))
-           (if (pair? (cdr indexes))
-               (and (= slope (- (cadr indexes) (car indexes)))
-                    (loop (cdr indexes)))
+         (let loop ((indexes* (cdr indexes)))
+           (if (pair? (cdr indexes*))
+               (and (= slope (- (cadr indexes*) (car indexes*)))
+                    (loop (cdr indexes*)))
                (linear-coder slope indexes))))))
 
 (define (linear-coder slope indexes)
@@ -662,7 +662,7 @@ USA.
 			   (make-index-code power)
 			   (code:* slope (make-index-code 0)))))))
 	      (if (< slope 0)
-		  (code:+ (last indexes) (make-offset (- slope)))
+		  (code:- (car indexes) (make-offset (- slope)))
 		  (code:+ (car indexes) (make-offset slope)))))))
 
 (define (try-8-bit-direct indexes)
@@ -712,6 +712,10 @@ USA.
         ((eqv? 0 b) a)
         (else `(fix:+ ,a ,b))))
 
+(define (code:- a b)
+  (cond ((eqv? 0 b) a)
+        (else `(fix:- ,a ,b))))
+
 (define (code:* a b)
   (cond ((or (eqv? 0 a) (eqv? 0 b)) 0)
         ((eqv? 1 a) b)