From 235c3cb105c3bac49e44296c8066cf7f1c585472 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 19 Feb 2015 13:14:51 -0500 Subject: [PATCH] * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl-macs.el | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) 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) -- 2.39.2