summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-12-28 11:54:34 +0100
committerAndrea Corallo <akrl@sdf.org>2020-12-28 16:12:08 +0100
commiteafcc8eda0a78e78d1a53b30dafb22786dd60591 (patch)
tree982a11d1c8ac0e1ae2701f55c233512f0645a057 /lisp/emacs-lisp/comp.el
parente532ec95529224025465421e97243fda7b559d9a (diff)
downloademacs-eafcc8eda0a78e78d1a53b30dafb22786dd60591.tar.gz
emacs-eafcc8eda0a78e78d1a53b30dafb22786dd60591.tar.bz2
emacs-eafcc8eda0a78e78d1a53b30dafb22786dd60591.zip
Propagate function calls also when hiddend under funcall
* lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate functions also when called under `funcall'. * test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index c6bd040e5f6..2ca7c50045e 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -2642,6 +2642,10 @@ Return non-nil if the function is folded successfully."
F is the function being called with arguments ARGS.
Fold the call in case."
(unless (comp-function-call-maybe-fold insn f args)
+ (when (and (eq 'funcall f)
+ (comp-mvar-value-vld-p (car args)))
+ (setf f (comp-mvar-value (car args))
+ args (cdr args)))
(when-let ((cstr-f (gethash f comp-known-func-cstr-h)))
(let ((cstr (comp-cstr-f-ret cstr-f)))
(setf (comp-mvar-range lval) (comp-cstr-range cstr)