master: find-class: check that the name is a symbol even when errorp is nil
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 bf6f4d7ae022468155ac0e7480dd22925b6bbc18 (commit)
from 1d77ce646e4c8439bc3e914912ad21af5693d0f4 (commit)
- Log -----------------------------------------------------------------
commit bf6f4d7ae022468155ac0e7480dd22925b6bbc18
Author: Stas Boukarev <[email protected]>
Date: Fri Apr 10 22:09:33 2026 +0300
find-class: check that the name is a symbol even when errorp is nil
---
src/compiler/fndb.lisp | 7 ++++---
src/pcl/macros.lisp | 6 ++++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp
index e2d2e036e..4bee1843f 100644
--- a/src/compiler/fndb.lisp
+++ b/src/compiler/fndb.lisp
@@ -1255,7 +1255,7 @@
(foldable flushable call))
(defknown acons (t t t) cons (movable flushable))
-(defknown pairlis (t t &optional t) list (flushable))
+(defknown pairlis (list list &optional list) list (flushable))
(defknown (rassoc assoc)
(t proper-list &key
@@ -2507,9 +2507,10 @@
(defknown (slot-boundp slot-exists-p) (t symbol) boolean)
(defknown sb-pcl::set-slot-value (t symbol t) t (any))
-(defknown find-class (symbol &optional t lexenv-designator) (or class null) ())
+;;; Not checking for lexenv-designator, it's ignored and checking doesn't provide much value
+(defknown find-class (symbol &optional t t) (or class null) ())
(defknown class-of (t) class (flushable))
-(defknown class-name (class) symbol (flushable))
+(defknown class-name (class) symbol (unsafely-flushable))
(defknown finalize
(t (function-designator () *) &key (:dont-save t))
diff --git a/src/pcl/macros.lisp b/src/pcl/macros.lisp
index c3fe24d81..821e37bf7 100644
--- a/src/pcl/macros.lisp
+++ b/src/pcl/macros.lisp
@@ -70,9 +70,11 @@
(or (condition-classoid-p classoid)
(defstruct-classoid-p classoid)))
(ensure-non-standard-class symbol classoid))))))
- (when errorp
+
+ (progn
(check-class-name symbol)
- (error 'class-not-found-error :name symbol))))
+ (when errorp
+ (error 'class-not-found-error :name symbol)))))
(defun find-class (symbol &optional (errorp t) environment)
(declare (ignore environment) (explicit-check))
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL