summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2022-10-28 11:33:24 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2022-10-28 11:33:24 -0400
commitd79cdcd4ff6687c2f0dcfde83ba36732408e52e8 (patch)
tree570e8832ca29ba5f8e6db49cd0b9b9acaf831011 /test/lisp/emacs-lisp
parentde5a3fa1e529810f30d461d6682762c9c5e564a4 (diff)
downloademacs-d79cdcd4ff6687c2f0dcfde83ba36732408e52e8.tar.gz
emacs-d79cdcd4ff6687c2f0dcfde83ba36732408e52e8.tar.bz2
emacs-d79cdcd4ff6687c2f0dcfde83ba36732408e52e8.zip
cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695
The new code to make interpreted closures safe-for-space introduced a regression in `cconv-tests-interactive-closure-bug51695`, only seen when using TEST_LOAD_EL. A few other issues were found and fixed along the way. * lisp/emacs-lisp/cconv.el (cconv-fv): Change calling convention and focus on finding the free variables. (cconv-make-interpreted-closure): New function. * lisp/loadup.el: Use `compiled-function-p` rather than `byte-code-function-p` so we also use safe-for-space interpreted closures when we build with native compilation. (internal-make-interpreted-closure-function): Use `cconv-make-interpreted-closure`. * src/eval.c (syms_of_eval): Rename `internal-filter-closure-env-function` to `internal-make-interpreted-closure-function`. (Ffunction): Let that new var build the actual closure. * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests-interactive-closure-bug51695): Test specifically the interpreted case.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/cconv-tests.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el
index 37470f863f3..e666fe0a4c2 100644
--- a/test/lisp/emacs-lisp/cconv-tests.el
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -351,11 +351,18 @@
(let ((f (let ((d 51695))
(lambda (data)
(interactive (progn (setq d (1+ d)) (list d)))
- (list (called-interactively-p 'any) data)))))
- (should (equal (list (call-interactively f)
- (funcall f 51695)
- (call-interactively f))
- '((t 51696) (nil 51695) (t 51697))))))
+ (list (called-interactively-p 'any) data))))
+ (f-interp
+ (eval '(let ((d 51695))
+ (lambda (data)
+ (interactive (progn (setq d (1+ d)) (list d)))
+ (list (called-interactively-p 'any) data)))
+ t)))
+ (dolist (f (list f f-interp))
+ (should (equal (list (call-interactively f)
+ (funcall f 51695)
+ (call-interactively f))
+ '((t 51696) (nil 51695) (t 51697)))))))
(provide 'cconv-tests)
;;; cconv-tests.el ends here