diff options
| author | Stefan Monnier | 2022-10-28 11:33:24 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2022-10-28 11:33:24 -0400 |
| commit | d79cdcd4ff6687c2f0dcfde83ba36732408e52e8 (patch) | |
| tree | 570e8832ca29ba5f8e6db49cd0b9b9acaf831011 /test | |
| parent | de5a3fa1e529810f30d461d6682762c9c5e564a4 (diff) | |
| download | emacs-d79cdcd4ff6687c2f0dcfde83ba36732408e52e8.tar.gz 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')
| -rw-r--r-- | test/lisp/emacs-lisp/cconv-tests.el | 17 |
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 @@ | |||
| 351 | (let ((f (let ((d 51695)) | 351 | (let ((f (let ((d 51695)) |
| 352 | (lambda (data) | 352 | (lambda (data) |
| 353 | (interactive (progn (setq d (1+ d)) (list d))) | 353 | (interactive (progn (setq d (1+ d)) (list d))) |
| 354 | (list (called-interactively-p 'any) data))))) | 354 | (list (called-interactively-p 'any) data)))) |
| 355 | (should (equal (list (call-interactively f) | 355 | (f-interp |
| 356 | (funcall f 51695) | 356 | (eval '(let ((d 51695)) |
| 357 | (call-interactively f)) | 357 | (lambda (data) |
| 358 | '((t 51696) (nil 51695) (t 51697)))))) | 358 | (interactive (progn (setq d (1+ d)) (list d))) |
| 359 | (list (called-interactively-p 'any) data))) | ||
| 360 | t))) | ||
| 361 | (dolist (f (list f f-interp)) | ||
| 362 | (should (equal (list (call-interactively f) | ||
| 363 | (funcall f 51695) | ||
| 364 | (call-interactively f)) | ||
| 365 | '((t 51696) (nil 51695) (t 51697))))))) | ||
| 359 | 366 | ||
| 360 | (provide 'cconv-tests) | 367 | (provide 'cconv-tests) |
| 361 | ;;; cconv-tests.el ends here | 368 | ;;; cconv-tests.el ends here |