diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2023-02-20 15:23:12 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2023-02-21 10:42:00 +0100 |
commit | db3fea2e5ce46229ae40aa9ca6a89964261a7a5a (patch) | |
tree | 43264b77f2bc165a310090c40065ee6dfc750169 /src/eval.c | |
parent | c4c4af022d6091537fb0d748342eba5e7d3ddd23 (diff) | |
download | emacs-db3fea2e5ce46229ae40aa9ca6a89964261a7a5a.tar.gz |
Detect and prevent function alias loops in `fset` and `defalias`
Make `fset` and `defalias` signal an error on attempts to create
circular alias chains. This is more effective, efficient and
convenient than permitting alias loops to be created and trying to
detect them at run time each time a function is called, which is what
we have been doing until now, badly.
* lisp/help-fns.el (help-fns--analyze-function):
Don't pass obsolete argument.
* lisp/subr.el (function-alias-p):
* src/data.c (indirect_function, Findirect_function): Simplify.
Now error-free, second argument obsolete.
(Ffset): Detect loops.
* test/lisp/help-fns-tests.el (help-fns--analyze-function-recursive):
* test/lisp/subr-tests.el (test-alias-p):
Adapt tests.
* test/src/data-tests.el (data-tests-fset, data-tests-defalias): New.
* doc/lispref/eval.texi (Function Indirection):
* doc/lispref/functions.texi (Defining Functions, Function Cells):
Update manual.
* etc/NEWS: Announce.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index e377e30c6fb..eb40c953f96 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2116,7 +2116,7 @@ then strings and vectors are not accepted. */) fun = function; - fun = indirect_function (fun); /* Check cycles. */ + fun = indirect_function (fun); if (NILP (fun)) return Qnil; |