summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-03-26 13:04:11 +0000
committerGerd Moellmann <gerd@gnu.org>2001-03-26 13:04:11 +0000
commitaefd695aadf810e2909ca6d7991161658d3b84f5 (patch)
treef54b69982f46876558ee23cd5382a604de9e54e5 /lisp/emacs-lisp
parent12deffc6f4ab80f135ba9fe22f402a95d01c3109 (diff)
downloademacs-aefd695aadf810e2909ca6d7991161658d3b84f5.tar.gz
emacs-aefd695aadf810e2909ca6d7991161658d3b84f5.tar.bz2
emacs-aefd695aadf810e2909ca6d7991161658d3b84f5.zip
(byte-optimize-while)
(byte-optimize-form-code-walker): Diagnose too few arguments for `if' and `while'.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-opt.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index da695386604..5c713b13449 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1,6 +1,6 @@
;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler.
-;;; Copyright (c) 1991, 1994, 2000 Free Software Foundation, Inc.
+;;; Copyright (c) 1991, 1994, 2000, 2001 Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz@lucid.com>
;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -445,6 +445,8 @@
(byte-optimize-body (cdr (cdr form)) for-effect))))
((eq fn 'if)
+ (when (< (length form) 3)
+ (byte-compile-warn "Too few arguments for `if'"))
(cons fn
(cons (byte-optimize-form (nth 1 form) nil)
(cons
@@ -1014,6 +1016,8 @@
(list 'progn clause nil)))))
(defun byte-optimize-while (form)
+ (when (< (length form) 2)
+ (byte-compile-warn "Too few arguments for `while'"))
(if (nth 1 form)
form))