mirror of
git://git.code.sf.net/p/sbcl/sbcl
synced 2026-09-10 07:26:40 -04:00
GET-EXTERNAL-FORMAT returns NIL for non-symbol XF designators
Fixes lp#2042600
This commit is contained in:
parent
74db98869a
commit
a83158c334
|
|
@ -470,6 +470,8 @@ STRING (or the subsequence bounded by START and END)."
|
|||
(defun get-external-format (external-format)
|
||||
(let* ((external-format (ensure-list external-format))
|
||||
(options (cdr external-format)))
|
||||
(unless (symbolp (car external-format))
|
||||
(return-from get-external-format nil))
|
||||
(loop for (option value) on options by 'cddr
|
||||
unless (or (eql option :newline) (eql option :replacement))
|
||||
do (return-from get-external-format nil))
|
||||
|
|
|
|||
|
|
@ -428,3 +428,12 @@
|
|||
(assert (string= b1 b2))
|
||||
;; COMPILE-FILE-POSITION is insensitive to file encoding.
|
||||
(assert (string= c1 c2))))))
|
||||
|
||||
(with-test (:name (:compile-constant-bad-external-format :octets-to-string))
|
||||
(checked-compile-and-assert ()
|
||||
'(lambda (x) (sb-ext:octets-to-string x :external-format 0))
|
||||
(((make-array 0 :element-type '(unsigned-byte 8))) (condition 'error))))
|
||||
(with-test (:name (:compile-constant-bad-external-format :string-to-octets))
|
||||
(checked-compile-and-assert ()
|
||||
'(lambda (x) (sb-ext:octets-to-string x :external-format 0))
|
||||
(("foo") (condition 'error))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue