]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp.el (comp-c-func-name): Fix for M-x disassemble
authorAndrea Corallo <akrl@sdf.org>
Mon, 6 Apr 2020 19:03:34 +0000 (20:03 +0100)
committerAndrea Corallo <akrl@sdf.org>
Mon, 6 Apr 2020 19:03:34 +0000 (20:03 +0100)
lisp/emacs-lisp/comp.el

index 3f4dba6b1ff7b4a3c156cc430a52d84717ddd144..9dc775bb6ac659a7bd5f80ae7b794b052dcd2102 100644 (file)
@@ -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."