]> git.eshelyaron.com Git - emacs.git/commitdiff
fix comp-limplify-listn
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sat, 3 Aug 2019 17:42:57 +0000 (19:42 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:56 +0000 (11:33 +0100)
lisp/emacs-lisp/comp.el
test/src/comp-tests.el

index 4841753172f735aeb1ab5f8adb711b0ae003090f..71d747428d8a78c03dc7231b522e48cbac0bdd0f 100644 (file)
@@ -381,7 +381,7 @@ If NEGATED non nil negate the tested condition."
 
 (defun comp-limplify-listn (n)
   "Limplify list N."
-  (comp-with-sp (1- n)
+  (comp-with-sp (+ (comp-sp) n -1)
     (comp-emit-set-call `(call Fcons
                                ,(comp-slot)
                                ,(make-comp-mvar :constant nil))))
index 58846ed50d05d9a813f2a19d5fb44029a79da76c..9fbff7639e9047a24fe6132e4245a88516071d1e 100644 (file)
@@ -45,6 +45,8 @@
   "Testing cons car cdr."
   (defun comp-tests-list-f ()
     (list 1 2 3))
+  (defun comp-tests-list2-f (a b c)
+    (list a b c))
   (defun comp-tests-car-f (x)
     ;; Bcar
     (car x))
     (cdr-safe x))
 
   (native-compile #'comp-tests-list-f)
+  (native-compile #'comp-tests-list2-f)
   (native-compile #'comp-tests-car-f)
   (native-compile #'comp-tests-cdr-f)
   (native-compile #'comp-tests-car-safe-f)
   (native-compile #'comp-tests-cdr-safe-f)
 
   (should (equal (comp-tests-list-f) '(1 2 3)))
+  (should (equal (comp-tests-list2-f 1 2 3) '(1 2 3)))
   (should (= (comp-tests-car-f '(1 . 2)) 1))
   (should (null (comp-tests-car-f nil)))
   (should (= (condition-case err