]> git.eshelyaron.com Git - emacs.git/commitdiff
fix comp-compute-edges handling all kind of branches
authorAndrea Corallo <akrl@sdf.org>
Mon, 16 Sep 2019 18:11:05 +0000 (20:11 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:49 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 04096d65a94c03fad842d79609cccd618462325a..c7d9ab379584300067858debeb77de847a27a26d 100644 (file)
@@ -1008,16 +1008,19 @@ Top level forms for the current context are rendered too."
     (cl-loop with blocks = (comp-func-blocks comp-func)
              for bb being each hash-value of blocks
              for last-insn = (car (last (comp-block-insns bb)))
-             for (op first _ third forth) = last-insn
+             for (op first second third forth) = last-insn
              do (cl-ecase op
                   (jump
-                   (edge-add :src bb :dst (gethash first
-                                                   blocks)))
+                   (edge-add :src bb :dst (gethash first blocks)))
                   (cond-jump
-                   (edge-add :src bb :dst (gethash third
-                                                   blocks))
-                   (edge-add :src bb :dst (gethash forth
-                                                   blocks)))
+                   (edge-add :src bb :dst (gethash third blocks))
+                   (edge-add :src bb :dst (gethash forth blocks)))
+                  (cond-jump-narg-leq
+                   (edge-add :src bb :dst (gethash second blocks))
+                   (edge-add :src bb :dst (gethash third blocks)))
+                  (push-handler
+                   (edge-add :src bb :dst (gethash third blocks))
+                   (edge-add :src bb :dst (gethash forth blocks)))
                   (return))
              finally (progn
                        (setf (comp-func-edges comp-func)