From e6de562931484e16e871f34438c9902b1c3149e9 Mon Sep 17 00:00:00 2001
From: wlott <wlott>
Date: Sat, 12 Jan 1991 23:23:45 +0000
Subject: [PATCH] Fixed bug in spell-root-word. It assumed that it could use
 subseq on a system area pointer.

---
 hemlock/spell-corr.lisp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hemlock/spell-corr.lisp b/hemlock/spell-corr.lisp
index f2b3056e5..e55959561 100644
--- a/hemlock/spell-corr.lisp
+++ b/hemlock/spell-corr.lisp
@@ -341,10 +341,14 @@
 (defun spell-root-word (index)
   "Return the root word corresponding to a dictionary entry at index."
   (let* ((start (descriptor-string-start index))
-	 (end (+ start (the fixnum (ldb stored-length-byte
-					(the fixnum (descriptor-ref index)))))))
-    (declare (fixnum start end))
-    (subseq (the simple-string *string-table*) start end)))
+	 (len (the fixnum (ldb stored-length-byte
+			       (the fixnum (descriptor-ref index)))))
+	 (result (make-string len)))
+    (declare (fixnum start len)
+	     (simple-string result))
+    (sap-replace result (the system-area-pointer *string-table*)
+		 start 0 len)
+    result))
 
 
 (eval-when (compile eval)
-- 
GitLab