From: Stefan Monnier Date: Thu, 19 Feb 2015 18:14:51 +0000 (-0500) Subject: * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type. X-Git-Tag: emacs-25.0.90~2564^2~345 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=235c3cb105c3bac49e44296c8066cf7f1c585472;p=emacs.git * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 933e5bbb515..bf6ea90510c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2015-02-19 Stefan Monnier + * emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type. + * emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem. 2015-02-18 Kelly Dean diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index caaf7687dc8..c5f49b0ed91 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -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)