Do not allow nil to be defined as a function
* lisp/emacs-lisp/byte-run.el (defun): * src/data.c (Ffset): Do not allow "nil". (Bug#25110)
This commit is contained in:
parent
0107336165
commit
ba8e883fa3
2 changed files with 4 additions and 0 deletions
|
@ -240,6 +240,7 @@ The return value is undefined.
|
|||
;; from
|
||||
;; (defun foo (arg) (toto)).
|
||||
(declare (doc-string 3) (indent 2))
|
||||
(or name (error "Cannot define '%s' as a function" name))
|
||||
(if (null
|
||||
(and (listp arglist)
|
||||
(null (delq t (mapcar #'symbolp arglist)))))
|
||||
|
|
|
@ -733,6 +733,9 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
|
|||
{
|
||||
register Lisp_Object function;
|
||||
CHECK_SYMBOL (symbol);
|
||||
/* Perhaps not quite the right error signal, but seems good enough. */
|
||||
if (NILP (symbol))
|
||||
xsignal1 (Qsetting_constant, symbol);
|
||||
|
||||
function = XSYMBOL (symbol)->function;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue