Skip to content

Commit 923aad8

Browse files
committed
Don't hide not and null arity errors
* lisp/emacs-lisp/byte-opt.el (byte-optimize-not): Don't silently convert incorrect `not` and `null` applications to nil.
1 parent 175a513 commit 923aad8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lisp/emacs-lisp/byte-opt.el

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,13 +1410,14 @@ See Info node `(elisp) Integer Basics'."
14101410
form)))
14111411

14121412
(defun byte-optimize-not (form)
1413-
(and (= (length form) 2)
1414-
(let ((arg (nth 1 form)))
1415-
(cond ((null arg) t)
1416-
((macroexp-const-p arg) nil)
1417-
((byte-compile-nilconstp arg) `(progn ,arg t))
1418-
((byte-compile-trueconstp arg) `(progn ,arg nil))
1419-
(t form)))))
1413+
(if (= (length form) 2)
1414+
(let ((arg (nth 1 form)))
1415+
(cond ((null arg) t)
1416+
((macroexp-const-p arg) nil)
1417+
((byte-compile-nilconstp arg) `(progn ,arg t))
1418+
((byte-compile-trueconstp arg) `(progn ,arg nil))
1419+
(t form)))
1420+
form))
14201421

14211422
(put 'and 'byte-optimizer #'byte-optimize-and)
14221423
(put 'or 'byte-optimizer #'byte-optimize-or)

0 commit comments

Comments
 (0)