emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1362a9f: Make lambda-lifting work again


From: Mattias Engdegård
Subject: master 1362a9f: Make lambda-lifting work again
Date: Fri, 5 Mar 2021 15:42:09 -0500 (EST)

branch: master
commit 1362a9fec4dff341a84c881ac17dbf1ee2cf82fd
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Make lambda-lifting work again
    
    * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Fix typo.
    * test/lisp/emacs-lisp/cconv-tests.el (cconv-convert-lambda-lifted):
    Add test case.
---
 lisp/emacs-lisp/cconv.el            | 2 +-
 test/lisp/emacs-lisp/cconv-tests.el | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 50a8beb..bd0a3e8 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -612,7 +612,7 @@ FORM is the parent form that binds this var."
      (push (cons (cons binder form) :captured+mutated)
            cconv-var-classification))
     (`(,(and binder `(,_ (function (lambda . ,_)))) nil nil nil t)
-     (push (cons (cons binder form) :lambda-candidates)
+     (push (cons (cons binder form) :lambda-candidate)
            cconv-var-classification))))
 
 (defun cconv--analyze-function (args body env parentform)
diff --git a/test/lisp/emacs-lisp/cconv-tests.el 
b/test/lisp/emacs-lisp/cconv-tests.el
index 5173733..5aeed0c 100644
--- a/test/lisp/emacs-lisp/cconv-tests.el
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -182,7 +182,14 @@
   (should (eq (cconv-tests-cl-defsubst) 'cl-defsubst-result)))
 
 (ert-deftest cconv-convert-lambda-lifted ()
-  "Bug#30872."
+  ;; Verify that lambda-lifting is actually performed at all.
+  (should (equal (cconv-closure-convert
+                  '#'(lambda (x) (let ((f #'(lambda () (+ x 1))))
+                                   (funcall f))))
+                 '#'(lambda (x) (let ((f #'(lambda (x) (+ x 1))))
+                                  (funcall f x)))))
+
+  ;; Bug#30872.
   (should
    (equal (funcall
            (byte-compile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]