]> git.eshelyaron.com Git - emacs.git/commitdiff
fix comp-copy-insn for dotted pairs
authorAndrea Corallo <akrl@sdf.org>
Sun, 10 Nov 2019 10:35:49 +0000 (11:35 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:02 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index 377886996eac49a45743b37193ae7882e32c7c18..b450f4d6f68d379dd543cc423781416d48e704ab 100644 (file)
@@ -1439,11 +1439,13 @@ PRE-LAMBDA and POST-LAMBDA are called in pre or post-order if non nil."
 
 (defun comp-copy-insn (insn)
   "Deep copy INSN."
-  (cl-loop for op in insn
-          collect (cl-typecase op
-                    (cons (comp-copy-insn op))
-                    (comp-mvar (copy-comp-mvar op))
-                    (t op))))
+  (cond
+   ((and (listp insn) (listp (cdr insn)))
+    (mapcar #'comp-copy-insn insn))
+   ((consp insn) ; Pair
+    (cons (car insn) (cdr insn)))
+   ((comp-mvar-p insn) (copy-comp-mvar insn))
+   (t insn)))
 
 (defun comp-basic-const-propagate ()
   "Propagate simple constants for setimm operands.