diff --git a/NEWS b/NEWS index 20abf71e4..07b2e1a5f 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,8 @@ changes in sbcl-0.9.14 relative to sbcl-0.9.13: * bug fix: saving large (>2GB) cores on x86-64 now works * bug fix: a x86-64 backend bug when compiling (setf aref) with a constant index and a (simple-array (signed-byte 32)) array + * bug fix: NAME-CHAR on an invalid symbol no longer signals an + error (patch by Robert J. Macomber) * fixed some bugs revealed by Paul Dietz' test suite: ** MISC.641: LET-conversion were not supposed to work in late compilation stages. diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index 18ea349e0..7f963b870 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -271,20 +271,21 @@ (let ((encoding (huffman-encode (string-upcase name) *unicode-character-name-huffman-tree*))) (when encoding - (let ((char-code - (car (binary-search encoding - (cdr *unicode-character-name-database*) - :key #'cdr))) - (name-length (length name))) + (let* ((char-code + (car (binary-search encoding + (cdr *unicode-character-name-database*) + :key #'cdr))) + (name-string (string name)) + (name-length (length name-string))) (cond (char-code (code-char char-code)) ((and (or (= name-length 9) (= name-length 5)) - (char-equal (char name 0) #\U) + (char-equal (char name-string 0) #\U) (loop for i from 1 below name-length - always (digit-char-p (char name i) 16))) - (code-char (parse-integer name :start 1 :radix 16))) + always (digit-char-p (char name-string i) 16))) + (code-char (parse-integer name-string :start 1 :radix 16))) (t nil))))))) diff --git a/tests/character.pure.lisp b/tests/character.pure.lisp index 56e899d23..37f4b49fe 100644 --- a/tests/character.pure.lisp +++ b/tests/character.pure.lisp @@ -71,3 +71,5 @@ (name (char-name char))) (unless graphicp (assert name)))) + +(assert (null (name-char 'foo))) diff --git a/version.lisp-expr b/version.lisp-expr index f8f679994..4eb4da53d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.13.19" +"0.9.13.20"