aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky2018-06-07 19:58:47 -0400
committerNoam Postavsky2018-06-16 18:34:19 -0400
commit6021e1db92e355fbf5c66765fb0bc4658a80180a (patch)
tree8f25fe69a434b94d34cd1f086dbd9f1f9009d60b /test
parent05345babc988060cca540770599282102c34f2a7 (diff)
downloademacs-6021e1db92e355fbf5c66765fb0bc4658a80180a.tar.gz
emacs-6021e1db92e355fbf5c66765fb0bc4658a80180a.zip
Don't forget to analyze args of lambda lifted functions (Bug#30872)
* lisp/emacs-lisp/cconv.el (cconv--convert-funcbody): New function. (cconv--convert-function): Extracted from here. (cconv-convert): Also use it here, in the lambda lifted case, so that mutated args are properly accounted for. * test/lisp/emacs-lisp/cconv-tests.el: New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/cconv-tests.el40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el
new file mode 100644
index 00000000000..d14847ce45e
--- /dev/null
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -0,0 +1,40 @@
1;;; cconv-tests.el -*- lexical-binding: t -*-
2
3;; Copyright (C) 2018 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22(require 'ert)
23
24(ert-deftest cconv-convert-lambda-lifted ()
25 "Bug#30872."
26 (should
27 (equal (funcall
28 (byte-compile
29 '#'(lambda (handle-fun arg)
30 (let* ((subfun
31 #'(lambda (params)
32 (ignore handle-fun)
33 (funcall #'(lambda () (setq params 42)))
34 params)))
35 (funcall subfun arg))))
36 nil 99)
37 42)))
38
39(provide 'cconv-tests)
40;; cconv-tests.el ends here.