Subject: master: Don't produce a compile time warning for (setf (char string 0) #\é)

stassats via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  adcd474725ac66823a316400917531c7afa6517e (commit)
      from  93c205db172417aa405910e93216bdfd0bf6d800 (commit)

- Log -----------------------------------------------------------------
commit adcd474725ac66823a316400917531c7afa6517e
Author: Stas Boukarev <[email protected]>
Date:   Sun Aug 9 01:20:46 2026 +0300

    Don't produce a compile time warning for (setf (char string 0) #\é)
---
 src/compiler/generic/vm-tran.lisp | 2 +-
 tests/array.pure.lisp             | 6 ++++++
 tests/utf-8.impure.lisp           | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/compiler/generic/vm-tran.lisp b/src/compiler/generic/vm-tran.lisp
index a0c1e4f89..983b98ba7 100644
--- a/src/compiler/generic/vm-tran.lisp
+++ b/src/compiler/generic/vm-tran.lisp
@@ -268,7 +268,7 @@
            (let ((data (truly-the (simple-array ,element-type-specifier 1) data)))
              ,(if stringp
                   `(if (simple-base-string-p data)
-                       (data-vector-set (truly-the (simple-array base-char (*)) data) index (the base-char ,new-value))
+                       (data-vector-set (truly-the (simple-array base-char (*)) data) index (the* (base-char :silent-conflict t) ,new-value))
                        (data-vector-set (truly-the (simple-array character (*)) data) index (the character ,new-value)))
                   `(data-vector-set data index ,new-value))
              ,truly-new-value))))))
diff --git a/tests/array.pure.lisp b/tests/array.pure.lisp
index 27d8b3309..de550a526 100644
--- a/tests/array.pure.lisp
+++ b/tests/array.pure.lisp
@@ -1166,3 +1166,9 @@
    (lambda (x n)
      (aref (if n (the string n) #(1 2)) x))
    (or (integer 1 2) character)))
+
+#+sb-unicode
+(with-test (:name :char-base-char-warning)
+  (checked-compile
+   `(lambda (s)
+      (setf (char s 0) (code-char 233)))))
diff --git a/tests/utf-8.impure.lisp b/tests/utf-8.impure.lisp
index 6ffe631bc..0f1023f67 100644
--- a/tests/utf-8.impure.lisp
+++ b/tests/utf-8.impure.lisp
@@ -334,6 +334,7 @@
                    (error "~s" vector))))))
       (free-protected-array string))))
 
+#+(or arm64 x86-64)
 (with-test (:name :character-string-to-utf8)
   (flet ((run-test (string obuf vector)
            (loop repeat (* 256 #+slow 10)

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL

_______________________________________________
Sbcl-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.