SBCL 2.4.4 miscategorizes type with safety 3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
This code previously compiled an ran with 2.4.0.
sbcl --version
SBCL 2.4.4
uname -a
Linux park 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
features:
(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
:NON-BASE-
:ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-
:PACKAGE-
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
Code
-------
;;;; sort-compile.asd
(asdf:defsystem #:sort-compile
:description "illustrate compile discrepancy"
:author "wglb <email address hidden>"
:license "Public Domain"
:version "0.0.1"
:serial t
:components ((:file "package")
;;;; package.lisp
(defpackage #:sort-compile
(:use #:cl))
;;;; sort-compile.lisp
(in-package #:sort-compile)
(declaim (optimize (speed 0) (safety 3) (debug 3) (space 0)))
(defun sort-wc (fn)
(let* ((pn (pathname-directory fn))
(outpn (make-pathname :directory pn
:name (pathname-name fn)
:type "wc-srt")))
(with-open-file (fi (probe-file fn) :direction :input)
(let* ((prestuff (read fi)))
(with-open-file (fo outpn :if-exists :supersede :if-does-not-exist :create)
(let ((rest-stuff (rest prestuff)))
(write (sort rest-stuff '< :key #'second) :stream fo))))))
nil)
-------
The code
(sort rest-stuff '< :key #'second)
Is flagged with
cd /home/data2/
3 compiler notes:
Unknown location:
error:
COMPILE-
compiling #<CL-SOURCE-FILE "sort-compile" "sort-compile">
sort-compile.
warning:
Derived type of ARRAY is
(VALUES (AND (SIMPLE-ARRAY * (*)) (NOT SIMPLE-VECTOR)) &OPTIONAL),
conflicting with its asserted type
SIMPLE-
See also:
SBCL Manual, Handling of Types [:node]
warning:
Derived type of ARRAY is
(VALUES (AND (SIMPLE-ARRAY * (*)) (NOT SIMPLE-VECTOR)) &OPTIONAL),
conflicting with its asserted type
SIMPLE-
See also:
SBCL Manual, Handling of Types [:node]
-------
The error goes away if safety is set to 0.
description: | updated |
Changed in sbcl: | |
status: | New → Fix Committed |
Can you test the latest revision?