1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 07:40:39 -08:00

; (find-function-search-for-symbol): Be cautious with macros.

* lisp/emacs-lisp/find-func.el
(find-function-search-for-symbol): Only attempt to expand
macros in trusted buffers.  (Bug#77341)
This commit is contained in:
Eshel Yaron 2025-03-28 17:57:35 +01:00
parent cd41247dc1
commit 3ee021dc19
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618

View file

@ -487,11 +487,14 @@ The search is done in the source for library LIBRARY."
;; If the regexp search didn't find the location of ;; If the regexp search didn't find the location of
;; the symbol (for example, because it is generated by ;; the symbol (for example, because it is generated by
;; a macro), try a slightly more expensive search that ;; a macro), try a slightly more expensive search that
;; expands macros until it finds the symbol. ;; expands macros until it finds the symbol. Since
;; macro-expansion involves arbitrary code execution,
;; only attempt it in trusted buffers.
(cons (current-buffer) (cons (current-buffer)
(find-function--search-by-expanding-macros (when (trusted-content-p)
(current-buffer) symbol type (find-function--search-by-expanding-macros
form-matcher-factory)))))))))) (current-buffer) symbol type
form-matcher-factory)))))))))))
;;;###autoload ;;;###autoload
(defun find-function-update-type-alist (symbol type variable) (defun find-function-update-type-alist (symbol type variable)