]> git.eshelyaron.com Git - emacs.git/commitdiff
(eieio--validate-slot-value): Don't break on struct objects
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 5 Jul 2025 15:17:51 +0000 (11:17 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 20:21:21 +0000 (22:21 +0200)
Nowadays `eieio-oset` applies to more than just EIEIO objects.
The old code tended to work OK but only because `eieio--class-slots`
is usually compiled/inlined without checks.

* lisp/emacs-lisp/eieio-core.el (eieio--validate-slot-value):
Don't assume CLASS is an EIEIO class.

(cherry picked from commit 4024a7d541ca049ca9b28bce54c225bf9691f944)

lisp/emacs-lisp/eieio-core.el

index 72640e88301e1710057926d6bd2d6b7de24626a1..0beca666c48ff8161a31f0a37a967c74f9f39f49 100644 (file)
@@ -681,7 +681,7 @@ an error."
       nil
     ;; Trim off object IDX junk added in for the object index.
     (setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots)))
-    (let* ((sd (aref (eieio--class-slots class)
+    (let* ((sd (aref (cl--class-slots class) ;??
                      slot-idx))
            (st (cl--slot-descriptor-type sd)))
       (cond