]> git.eshelyaron.com Git - emacs.git/commitdiff
fix comp-emit-narg-prologue
authorAndrea Corallo <akrl@sdf.org>
Sun, 27 Oct 2019 16:13:03 +0000 (17:13 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:59 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index 1891398c1493328757e1b33288f246640fb8e47d..abcddda38089a7d8e99abdedef920f7c44b47e1b 100644 (file)
@@ -1008,14 +1008,17 @@ the annotation emission."
               (comp-make-curr-block bb (comp-sp))
               (comp-emit `(set-args-to-local ,(comp-slot-n i)))
               (comp-emit '(inc-args))
-           finally (comp-emit '(jump entry_rest_args)))
+              finally (comp-emit '(jump entry_rest_args)))
   (when (not (= minarg nonrest))
     (cl-loop for i from minarg below nonrest
+             for bb = (intern (format "entry_fallback_%s" i))
+             for next-bb = (if (= (1+ i) nonrest)
+                               'entry_rest_args
+                             (intern (format "entry_fallback_%s" (1+ i))))
              do (comp-with-sp i
-                  (comp-make-curr-block (intern (format "entry_fallback_%s" i))
-                                        (comp-sp))
-                  (comp-emit-set-const nil))
-             finally (comp-emit '(jump entry_rest_args))))
+                  (comp-make-curr-block bb (comp-sp))
+                  (comp-emit-set-const nil)
+                  (comp-emit `(jump ,next-bb)))))
   (comp-make-curr-block 'entry_rest_args (comp-sp))
   (comp-emit `(set-rest-args-to-local ,(comp-slot-n nonrest))))