]> git.eshelyaron.com Git - emacs.git/commitdiff
* Don't iterate over an hash table while modifyiong it in comp.
authorAndrea Corallo <acorallo@gnu.org>
Tue, 1 Oct 2024 16:15:02 +0000 (18:15 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 3 Oct 2024 06:39:46 +0000 (08:39 +0200)
* lisp/emacs-lisp/comp.el: Don't iterate over the hash values directly
as 'comp--add-cond-cstrs-target-block' can modify the hash content.

(cherry picked from commit 372ce6adbf39c5b9ec92e103abe70af872085119)

lisp/emacs-lisp/comp.el

index f1c8f02ebc3aeb0cf9c8a5aa33af31e3d53236b5..342212f5185b4c096ca7c0678d2006cf3bb89f4c 100644 (file)
@@ -1974,7 +1974,11 @@ TARGET-BB-SYM is the symbol name of the target block."
 (defun comp--add-cond-cstrs-simple ()
   "`comp--add-cstrs' worker function for each selected function."
   (cl-loop
-   for b being each hash-value of (comp-func-blocks comp-func)
+   ;; Don't iterate over hash values directly as
+   ;; `comp--add-cond-cstrs-target-block' can modify the hash table
+   ;; content.
+   for b in (cl-loop for b being each hash-value of (comp-func-blocks comp-func)
+                     collect b)
    do
    (cl-loop
     named in-the-basic-block