summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-04-06 20:03:34 +0100
committerAndrea Corallo <akrl@sdf.org>2020-04-06 20:03:34 +0100
commit32a079aef290fdc8913c1ce4e8910e63e6ff6dcc (patch)
tree0b3bed0e13b961eaad2960ed9987633c281d9df0 /lisp/emacs-lisp/comp.el
parenta04c960a358811b598434c62528d2cac8a2a1cb7 (diff)
downloademacs-32a079aef290fdc8913c1ce4e8910e63e6ff6dcc.tar.gz
emacs-32a079aef290fdc8913c1ce4e8910e63e6ff6dcc.tar.bz2
emacs-32a079aef290fdc8913c1ce4e8910e63e6ff6dcc.zip
* lisp/emacs-lisp/comp.el (comp-c-func-name): Fix for M-x disassemble
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 3f4dba6b1ff..9dc775bb6ac 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -474,14 +474,18 @@ Put PREFIX in front of it."
"-" "_" orig-name))
(human-readable (replace-regexp-in-string
(rx (not (any "0-9a-z_"))) "" human-readable)))
- ;; Prevent C namespace conflicts.
- (cl-loop
- with h = (comp-ctxt-funcs-h comp-ctxt)
- for i from 0
- for c-sym = (concat prefix crypted "_" human-readable "_"
- (number-to-string i))
- unless (gethash c-sym h)
- return c-sym)))
+ (if comp-ctxt
+ ;; Prevent C namespace conflicts.
+ (cl-loop
+ with h = (comp-ctxt-funcs-h comp-ctxt)
+ for i from 0
+ for c-sym = (concat prefix crypted "_" human-readable "_"
+ (number-to-string i))
+ unless (gethash c-sym h)
+ return c-sym)
+ ;; When called out of a compilation context (ex disassembling)
+ ;; pick the first one.
+ (concat prefix crypted "_" human-readable "_0"))))
(defun comp-decrypt-arg-list (x function-name)
"Decript argument list X for FUNCTION-NAME."