master: Check types in broadcast-stream output routines

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  563243a3cabe2a8089b6eae815a6c614e7d45f5b (commit)
      from  f7ac72d9f89410b13958652827652d9e1e80fad0 (commit)

- Log -----------------------------------------------------------------
commit 563243a3cabe2a8089b6eae815a6c614e7d45f5b
Author: Stas Boukarev <[email protected]>
Date:   Fri Apr 10 19:30:28 2026 +0300

    Check types in broadcast-stream output routines
---
 src/code/stream.lisp | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/src/code/stream.lisp b/src/code/stream.lisp
index fd94b167f..c4f59fefe 100644
--- a/src/code/stream.lisp
+++ b/src/code/stream.lisp
@@ -859,16 +859,23 @@
              :expected-type '(satisfies output-stream-p))))
   (let ((stream (%make-broadcast-stream streams)))
     (unless streams
-      (flet ((out (stream arg)
-               (declare (ignore stream)
-                        (optimize speed (safety 0)))
-               arg)
-             (sout (stream string start end)
-               (declare (ignore stream string start end)
-                        (optimize speed (safety 0)))))
-        (setf (broadcast-stream-cout stream) #'out
-              (broadcast-stream-bout stream) #'out
-              (broadcast-stream-sout stream) #'sout)))
+      (setf (broadcast-stream-cout stream)
+            (lambda (stream char)
+              (declare (ignore stream)
+                       (character char)
+                       (optimize speed (sb-c:verify-arg-count 0)))
+              char)
+            (broadcast-stream-bout stream)
+            (lambda (stream integer)
+              (declare (ignore stream)
+                       (integer integer)
+                       (optimize speed (sb-c:verify-arg-count 0)))
+              integer)
+            (broadcast-stream-sout stream)
+            (lambda (stream string start end)
+              (declare (ignore stream string start end)
+                       (string string)
+                       (optimize speed (sb-c:verify-arg-count 0))))))
     stream))
 
 (macrolet ((out-fun (name fun args return)

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


hooks/post-receive
-- 
SBCL
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.