cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 Oct 2022 15:33:24 +0000 (11:33 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 28 Oct 2022 15:33:24 +0000 (11:33 -0400)
commitd79cdcd4ff6687c2f0dcfde83ba36732408e52e8
tree570e8832ca29ba5f8e6db49cd0b9b9acaf831011
parentde5a3fa1e529810f30d461d6682762c9c5e564a4
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.
lisp/emacs-lisp/cconv.el
lisp/loadup.el
src/eval.c
test/lisp/emacs-lisp/cconv-tests.el