* lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type.

This commit is contained in:
Stefan Monnier 2015-02-19 13:14:51 -05:00
parent a2f904981d
commit 235c3cb105
2 changed files with 5 additions and 3 deletions

View file

@ -2978,9 +2978,9 @@ STRUCT and SLOT-NAME are symbols. INST is a structure instance."
;; We could use `elt', but since the byte compiler will resolve the
;; branch below at compile time, it's more efficient to use the
;; type-specific accessor.
(if (eq (cl-struct-sequence-type ,struct-type) 'vector)
(aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name))
(nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst))))))
(if (eq (cl-struct-sequence-type ,struct-type) 'list)
(nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst)
(aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name)))))))
(run-hooks 'cl-macs-load-hook)