]> git.eshelyaron.com Git - emacs.git/commitdiff
better comp-limplify-block
authorAndrea Corallo <akrl@sdf.org>
Sun, 27 Oct 2019 09:24:03 +0000 (10:24 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:59 +0000 (11:37 +0100)
do not non fall through blocks

lisp/emacs-lisp/comp.el

index b02f846eb9b190ccd6df649ae05db698c7bc4d3c..858a49b280944e6fc7c73968fb748885b65396fa 100644 (file)
@@ -1079,21 +1079,18 @@ The block name is returned."
                             (comp-func-lap comp-func))
    for inst = (car inst-cell)
    for next-inst = (car-safe (cdr inst-cell))
-   for fall-through = (comp-lap-fall-through-p inst)
    do (comp-limplify-lap-inst inst)
       (cl-incf (comp-limplify-pc comp-pass))
-      (pcase next-inst
+   when (comp-lap-fall-through-p inst)
+   do (pcase next-inst
         (`(TAG ,_label . ,label-sp)
-         (when (and label-sp fall-through)
+         (when label-sp
            (cl-assert (= (1- label-sp) (comp-sp))))
          (let* ((stack-depth (if label-sp
                                  (1- label-sp)
-                               (if fall-through
-                                   (comp-sp)
-                                 (error "Unknown stack depth."))))
-               (next-bb (comp-add-pending-block stack-depth)))
-           (when (and fall-through
-                      (not (comp-block-closed bb)))
+                               (comp-sp)))
+                (next-bb (comp-add-pending-block stack-depth)))
+           (unless (comp-block-closed bb)
              (comp-emit `(jump ,next-bb))))
          (cl-return)))
    until (comp-lap-eob-p inst)))