summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cconv.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-02-26 16:01:02 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2011-02-26 16:01:02 -0500
commit39605a343b566a1a72e0afb61f96d085c2ef8054 (patch)
tree0522f2968356894775a72c41f7eee4609354f320 /lisp/emacs-lisp/cconv.el
parenta9de04fa62f123413d82b7b7b1e7a77705eb82dd (diff)
downloademacs-39605a343b566a1a72e0afb61f96d085c2ef8054.tar.gz
* lisp/emacs-lisp/cconv.el (cconv-closure-convert-rec): Fix last change for
λ-lift candidates that end up not λ-lifted.
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r--lisp/emacs-lisp/cconv.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index 0e4b5d31699..006e2ef904c 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -1,4 +1,4 @@
-;;; cconv.el --- Closure conversion for statically scoped Emacs lisp. -*- lexical-binding: t -*-
+;;; cconv.el --- Closure conversion for statically scoped Emacs lisp. -*- lexical-binding: t; coding: utf-8 -*-
;; Copyright (C) 2011 Free Software Foundation, Inc.
@@ -261,7 +261,8 @@ Returns a form where all lambdas don't have any free variables."
(eq (car (cadr value)) 'lambda)))
(assert (equal (cddr (cadr value))
(caar cconv-freevars-alist)))
- (let* ((fv (cdr (pop cconv-freevars-alist)))
+ ;; Peek at the freevars to decide whether to λ-lift.
+ (let* ((fv (cdr (car cconv-freevars-alist)))
(funargs (cadr (cadr value)))
(funcvars (append fv funargs))
(funcbodies (cddadr value)) ; function bodies
@@ -269,10 +270,14 @@ Returns a form where all lambdas don't have any free variables."
; lambda lifting condition
(if (or (not fv) (< cconv-liftwhen (length funcvars)))
; do not lift
- (cconv-closure-convert-rec
- value emvrs fvrs envs lmenvs)
+ (cconv-closure-convert-rec
+ value emvrs fvrs envs lmenvs)
; lift
(progn
+ (setq cconv-freevars-alist
+ ;; Now that we know we'll λ-lift, consume the
+ ;; freevar data.
+ (cdr cconv-freevars-alist))
(dolist (elm2 funcbodies)
(push ; convert function bodies
(cconv-closure-convert-rec