From: Andrea Corallo Date: Mon, 18 Sep 2023 08:04:57 +0000 (+0200) Subject: * Fix comp-function-type-spec for non symbol input (bug#66021) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=991bf3f0f5dff66794785ebfcc867611fe75e0da;p=emacs.git * Fix comp-function-type-spec for non symbol input (bug#66021) * lisp/emacs-lisp/comp.el (comp-function-type-spec): Make it robust against closures (bug#66021). --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index bb4552459dd..e1bb70fe5d4 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -4506,8 +4506,10 @@ inferred from the code itself by the native compiler; if it is type-spec ) (when-let ((res (gethash function comp-known-func-cstr-h))) (setf type-spec (comp-cstr-to-type-spec res))) - (let ((f (symbol-function function))) - (when (and (null type-spec) + (let ((f (and (symbolp function) + (symbol-function function)))) + (when (and f + (null type-spec) (subr-native-elisp-p f)) (setf kind 'inferred type-spec (subr-type f))))